Open sol-vin opened 1 month ago
This actually works with class variables because of this line:
The same pushing_type
is missing in the corresponding part of Crystal::InstanceVarsInitializerVisitor
.
It seems like jennifer fails to build due to the same issue here.
No, that failure is likely due to https://github.com/crystal-lang/crystal/issues/11181 given it's pointing at a method parameter.
The jennifer failure is indeed caused by #11181, the tests passed after reverting the code change in #11208
Bug Report
It seems when assigning to an ivar and using a block at the same time any module references must use a FQN to be findable. The below minimal example illustrates the problem.
Thanks @Blacksmoke16 for the minimal example.
This produces a compile error
Error: undefined constant B
Temporary Fix
By changing
@data : B = 1.try { B.new }
to@data : B = 1.try { A::B.new }
the program will compile again.Crystal