Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gbracha opened this issue May 16, 2012 · 2 comments
Assignees
Milestone

Comments

@gbracha
Copy link
Contributor

gbracha commented May 16, 2012

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.

@kasperl
Copy link

kasperl commented Sep 3, 2012

Set owner to @karlklose.
Added this to the M1 milestone.
Marked this as being blocked by #3093.
Unmarked this as being blocked by #3093.

@karlklose
Copy link
Contributor

Fixed in revision 12011.


Added Fixed label.

@gbracha gbracha added this to the M1 milestone Sep 7, 2012
whesse pushed a commit that referenced this issue Dec 6, 2017
However, the test still fails, but that's because of an inconsistency
which we can revisit later. The comment describes it best.

This is the stack trace of the failure:

AnalysisException: Element mismatch in /test.dart at class B
Caused by Bad state: Expected an element matching ``, got `x`
\#0      DeclarationResolver._match (package:analyzer/src/generated/declaration_resolver.dart:585:7)
\#1      DeclarationResolver.visitVariableDeclaration (package:analyzer/src/generated/declaration_resolver.dart:520:31)
\#2      VariableDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:11058:49)
\#3      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7987:20)
\#4      DeclarationResolver.visitVariableDeclarationList (package:analyzer/src/generated/declaration_resolver.dart:543:22)
\#5      VariableDeclarationListImpl.accept (package:analyzer/src/dart/ast/ast.dart:11154:15)
\#6      FieldDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4372:17)
\#7      RecursiveAstVisitor.visitFieldDeclaration (package:analyzer/dart/ast/visitor.dart:827:10)
\#8      DeclarationResolver.visitFieldDeclaration (package:analyzer/src/generated/declaration_resolver.dart:226:32)
\#9      FieldDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:4367:49)
\#10     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7987:20)


Bug:
Change-Id: Ia0d8536e2f259c9e9c0b46366794e07796750467
Reviewed-on: https://dart-review.googlesource.com/26465
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants