Skip to content
This repository has been archived by the owner on Jun 20, 2021. It is now read-only.

final variable initialized as null does not allow re initialization to real value #54

Open
Thecarisma opened this issue Dec 31, 2018 · 2 comments
Assignees

Comments

@Thecarisma
Copy link
Contributor

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
@Thecarisma Thecarisma self-assigned this Dec 31, 2018
@Youngestdev
Copy link
Contributor

Eh, well. I think a final variable should be defined with whatever it should be allocated to.

@Thecarisma
Copy link
Contributor Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants