Skip to content

class Crystal::EnumType
inherits Crystal::ModuleType

An instantiated enum type.

Todo

right now this is not properly modeled. Ideally there should be EnumType and EnumInstanceType, where EnumType would be Enum(T) and given:

enum Foo : Int32
  # ...
end

we'd have:

enum Foo < Enum(Int32)
end

but right now that's not the case.

Included modules

Crystal::ClassVarContainer Crystal::DefInstanceContainer

Class methods

.new(program, namespace, name, base_type)

View source

Methods

#add_constant(constant)

View source

#base_type : IntegerType

View source

#find_member(name)

View source

#flags=(flags)

View source

#flags? : Bool

View source

#lookup_new_in_ancestors?

Should new be looked up in ancestors?

This is true if this type doesn't define any initialize methods.

View source

#parents

View source

#type_desc

View source