Skip to content

class Crystal::MetaclassType
inherits Crystal::ClassType

A metaclass type, that results from invoking .class on a type.

For example String.class is the metaclass of String, and it's the type of String (the type of "foo" is String, the type of String is String.class).

This metaclass represents only the metaclass of non-generic types.

Included modules

Crystal::ClassVarContainer

Class methods

.new(program, instance_type : Type, super_class = nil, name = nil)

View source

Methods

#abstract?(*args, **options)

View source

#abstract?

View source

#class_var_owner

Returns the type that owns class vars for a type.

This method returns self, but subclasses might override. For example, a metaclass' class_var_owner is the instance type.

View source

#generic_nest(*args, **options)

View source

#generic_nest

View source

#instance_type : Type

View source

#lookup_new_in_ancestors?

View source

#lookup_new_in_ancestors?(*args, **options)

View source

#lookup_path(*args, **options)

View source

#lookup_path

View source

#lookup_similar_path

View source

#lookup_similar_path(*args, **options)

View source

#metaclass

Returns this type's metaclass, which holds class methods for this type.

View source

#remove_typedef

View source

#replace_type_parameters(instance)

Replace type parameters in this type with the type parameters of the given instance type.

View source

#restrict(other : VirtualMetaclassType, context)

View source

#restrict(other : Metaclass, context)

View source

#restriction_of?(other : VirtualMetaclassType, owner, strict = false)

View source

#to_s_with_options(io : IO, skip_union_parens : Bool = false, generic_args : Bool = true, codegen : Bool = false) : Nil

View source

#type_var?

View source

#type_var?(*args, **options)

View source

#virtual_type

View source

#virtual_type!

View source