Skip to content

class Crystal::AliasType
inherits Crystal::NamedType

An alias type.

Class methods

.new(program, namespace, name, value : ASTNode)

View source

Methods

#aliased_type : Type

#aliased_type=(aliased_type : Type)

View source

#aliased_type? : Type?

#can_be_stored?

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.

View source

#cover

View source

#cover(*args, **options)

View source

#cover_size

View source

#cover_size(*args, **options)

View source

#includes_type?(other)

View source

#llvm_name(io)

View source

#lookup_defs

View source

#lookup_defs(*args, **options)

View source

#lookup_defs_with_modules(*args, **options)

View source

#lookup_defs_with_modules

View source

#lookup_first_def

View source

#lookup_first_def(*args, **options)

View source

#lookup_macro(*args, **options)

View source

#lookup_macro

View source

#lookup_macros(*args, **options)

View source

#lookup_macros

View source

#lookup_matches

View source

#lookup_matches(*args, **options)

View source

#lookup_matches_without_parents(*args, **options)

View source

#lookup_matches_without_parents

View source

#lookup_path_item(name : String, lookup_in_namespace, include_private, location)

Looks up a single path item relative to *self`.

If lookup_in_namespace is true, if the type is not found in self or self's parents, the path item is searched in this type's namespace. This parameter is useful because when writing Foo::Bar::Baz, Foo should be searched in enclosing namespaces, but Bar and Baz not.

View source

#lookup_similar_def

View source

#lookup_similar_def(*args, **options)

View source

#process_value

View source

#remove_alias

View source

#remove_alias_if_simple

View source

#remove_indirection

View source

#restrict(other : Path, context)

View source

#restrict(other : AliasType, context)

View source

#restrict(other, context)

View source

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

View source

#simple? : Bool

View source

#type_desc

View source

#types

View source

#types?

View source

#value_processed? : Bool

View source