Open HertzDevil opened 11 months ago
So the codegen issue is that class vars and constants of the same name would result in the same init function?
@@A
and A
both use a function called something like Namespace:A:init
as initializer.
I suppose we could prevent this collision by introducing disambiguation (e.g. Namespace:const_A:init
, Namespace:var_A:init
).
But I don't see much value in allowing uppercase class or instance variables. I think it's pretty unexpected that this is even possible. Probably nobody will miss this, so I'd be happy to remove this syntax. To be sure on this, we can start deprecating it.
It is in fact possible to define instance or class variables whose name starts with an uppercase letter:
The same holds for Ruby as well. However, this is causing codegen problems for us, such as in #7865.
Should we deprecate this syntax or do we accept it as valid?