abstract class Crystal::ClassType
inherits Crystal::ModuleType
¶
Abstract base type for classes and structs
(types that can be allocated via the allocate method).
Included modules
Crystal::DefInstanceContainer
Crystal::InstanceVarInitializerContainer
Crystal::SubclassObservable
Direct known subclasses
Crystal::GenericClassType
Crystal::MetaclassType
Crystal::NonGenericClassType
Crystal::PrimitiveType
Class methods¶
Methods¶
#can_be_stored? : Bool
¶
: Bool
Returns true if this type can be assigned to an instance or class
variable, or used in a generic type argument.
As of now, abstract base type such as Object, Reference, Value,
Int, and unbound generic types such as Array(T), can't be stored.
#extern? : Bool
¶
: Bool
Returns true if this is an extern C struct or union (extern_union? tells which one)
#extern_union? : Bool
¶
: Bool
Returns true if this is an extern C union (extern? will be true too)
#lookup_new_in_ancestors? : Bool
¶
: Bool
Should new be looked up in ancestors?
This is true if this type doesn't define any
initialize methods.
#packed? : Bool
¶
: Bool
Returns true if this type has the @[Packed] annotation on it
(only applicable for C structs)