Skip to content

Dart2js change: Undeclared static setter calls: Compile time error becomes static warning per spec, 10.16 #3095

Closed
@gbracha

Description

@gbracha

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions