final variable initialized as null does not allow re initialization to real value
Thecarisma opened this issue · 2 comments
Thecarisma commented
Following initailization of a final variable to null the variable should be able to allow initialization once more to real value instead of throwing Cannot assign a value to the final variable
error.
Example :
final variable = null
variable = true #throws an error, it should not
Youngestdev commented
Eh, well. I think a final variable should be defined with whatever it should be allocated to.
Thecarisma commented
Some time the initialization might be required to occur in a constructor or method such as
class TClass
final variable = null
block TClass(param)
variable = param #throw error it should not occur
Although the approach below work
class TClass
final variable
block TClass(param)
variable = param #no error
but sometime people can default to the above therefore the behavior should be the same.
null is currently an empty string which might be what is confusing the vm I ll open an issue for the null to be a true NULL pointer