Skip to content

class Crystal::MetaTypeVar
inherits Crystal::Var

A variable belonging to a type: a global, class or instance variable (globals belong to the program).

Included modules

Crystal::Annotatable

Methods

#global?

View source

#initializer : ClassVarInitializer?

The (optional) initial value of a class variable

View source

#initializer=(initializer : ClassVarInitializer?)

The (optional) initial value of a class variable

View source

#kind

View source

#nil_reason : NilReason?

View source

#nil_reason=(nil_reason : NilReason?)

View source

#no_init_flag=(no_init_flag)

If true, there's no need to check whether the class var was initialized or not when reading it.

View source

#no_init_flag? : Bool

If true, there's no need to check whether the class var was initialized or not when reading it.

View source

#owner : Type

The owner of this variable, useful for showing good error messages.

#owner=(owner : Type)

The owner of this variable, useful for showing good error messages.

View source

#owner? : Type?

The owner of this variable, useful for showing good error messages.

#read=(read)

Was this class_var already read during the codegen phase? If not, and we are at the place that declares the class var, we can directly initialize it now, without checking for an init flag.

View source

#read? : Bool

Was this class_var already read during the codegen phase? If not, and we are at the place that declares the class var, we can directly initialize it now, without checking for an init flag.

View source

#simple_initializer=(simple_initializer)

Flag used during codegen to indicate the initializer is simple and doesn't require a call to a function

View source

#simple_initializer? : Bool

Flag used during codegen to indicate the initializer is simple and doesn't require a call to a function

View source

#thread_local=(thread_local)

Is this variable thread local? Only applicable to global and class variables.

View source

#thread_local? : Bool

Is this variable thread local? Only applicable to global and class variables.

View source

#uninitialized=(uninitialized)

Is this variable "unsafe" (no need to check if it was initialized)?

View source

#uninitialized? : Bool

Is this variable "unsafe" (no need to check if it was initialized)?

View source