Open bmathewcertinia opened 1 year ago
I am OK with these differences but I think we should change the warning message a little, from can not be assigned to, it is finalto
should not be assigned to, it is final` to indicate we don't think you should do this, but you can if you really want.
This contains a collection of Final assignment issues that differ from what Apex allows and the way we have implemented it. Apex is not consistent with the final assignment rules, we are trying to be slightly better.
Local Unassigned final value
Currently the below snippet produces the error
Variable 'actualMessage' can not be assigned to, it is final
This is covered by the unit test
Non-Initialised local
inFinalTest.scala
Reassigning a null final variable
If the first assignment of a final variable is null wither explicitly or from a function then reassigning it after a null check is valid in Apex but apex-ls do not allow any modification of final assignment after it is assigned.