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

Analyzer: Eliminate warning for instance/static method clash #31351

Open
eernstg opened this Issue Nov 10, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@eernstg
Member

eernstg commented Nov 10, 2017

This is the analyzer specific issue for #31201, which has the details.

@bwilkerson

This comment has been minimized.

Show comment
Hide comment
@eernstg

This comment has been minimized.

Show comment
Hide comment
@eernstg

eernstg Aug 27, 2018

Member

I tried out the following:

class A {
  static int get foo => 42;
  static int bar() => 42;
  static int baz = 12;
}

class B extends A {
  set foo(int i) { print(i); }
  int bar() => 42;
  int baz = 12;
}

main() {
  B().foo = A.foo + B().bar() - A.bar() + B().baz - A.baz;
}

Running dartanalyzer version 2.1.0-dev.2.0 on that yields the following:

Analyzing n014.dart...
  error • Superclass 'A' declares a static member with the same name at n014.dart:12:7 • conflicting_instance_setter_and_superclass_member
  error • Superclass 'A' declares static member with the same name at n014.dart:14:7 • conflicting_instance_getter_and_superclass_member
2 errors found.

This seems to imply that the error message is still being emitted, at least for several kinds of clashes of the kind that this issue requests should no longer be an error.

Member

eernstg commented Aug 27, 2018

I tried out the following:

class A {
  static int get foo => 42;
  static int bar() => 42;
  static int baz = 12;
}

class B extends A {
  set foo(int i) { print(i); }
  int bar() => 42;
  int baz = 12;
}

main() {
  B().foo = A.foo + B().bar() - A.bar() + B().baz - A.baz;
}

Running dartanalyzer version 2.1.0-dev.2.0 on that yields the following:

Analyzing n014.dart...
  error • Superclass 'A' declares a static member with the same name at n014.dart:12:7 • conflicting_instance_setter_and_superclass_member
  error • Superclass 'A' declares static member with the same name at n014.dart:14:7 • conflicting_instance_getter_and_superclass_member
2 errors found.

This seems to imply that the error message is still being emitted, at least for several kinds of clashes of the kind that this issue requests should no longer be an error.

@eernstg

This comment has been minimized.

Show comment
Hide comment
@eernstg

eernstg Aug 27, 2018

Member

Re-opening this issue, I believe that there is still work to do for the analyzer, as described here.

Member

eernstg commented Aug 27, 2018

Re-opening this issue, I believe that there is still work to do for the analyzer, as described here.

@eernstg eernstg reopened this Aug 27, 2018

@bwilkerson bwilkerson removed their assignment Sep 3, 2018

@bwilkerson bwilkerson added the type-bug label Sep 3, 2018

@bwilkerson bwilkerson added this to the Dart2.1 milestone Sep 3, 2018

@bwilkerson bwilkerson modified the milestones: Dart2.1, PostDart2.1 Sep 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment