VM change: Undeclared static setter calls: Compile time error becomes static warning per spec, 10.16 #3094
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Milestone
Spec section 10.16 has changed its handling of static setters (assignment)
If there is no class C in the enclosing lexical scope of the assignment, or if C does not declare, implicitly or explicitly, a setter v, then a NoSuchMethodError is thrown. Otherwise, the expression e is evaluated to an object o. Then, the setter C.v is invoked with its formal parameter bound to o. The value of the assignment expression is o.
It is a static warning if there is no class C in the enclosing lexical scope of the assignment, or if C does not declare, implicitly or explicitly, a setter v.
So, what was once a compile-time error is now a warning. Consequently, the situation where the warning arises need sto be handled dynamically via a NoSuchMethodError.
The text was updated successfully, but these errors were encountered: