class Crystal::TypeDeclarationProcessor::InstanceVarTypeInfo
inherits Reference
¶
The types we guess for instance types can be nodes or types. In the case of a generic type we might have:
class Foo(T)
def foo
@x = T.new
end
def foo
@x = 1
end
end
In the above case we know @x is of type T (but we don't know what T is when instantiated) and Int32 (we know that type). So we keep a list of all types and nodes, and we eventually resolve them all when a generic type is instantiated.