Skip to content

Missing override errors on name collisions and default values #27476

Closed
@sgrekhov

Description

@sgrekhov

Analyzer has stopped report errors (in a strong mode) in many cases. A couple of examples:

class A {
  static var f;
}
abstract class B extends A {
  f();
}
class C extends B {
  f() {}
}
main() {
  new C().f();
}

Output:
analyzer 1.20.0-dev.10.0 strong mode:
No issues found
analyzer 1.20.0-dev.10.0 nostrong mode:
[warning] 'f' collides with a static member in the superclass 'A'
[warning] 'f' collides with a static member in the superclass 'A'
analyzer 1.19.1 strong mode:
[error] 'f' collides with a static member in the superclass 'A'
[error] 'f' collides with a static member in the superclass 'A'

Another example

class A {
  foo([x = 1]) {}
}
class C extends A {
  foo([x = '']);
}
main() {
  new C().foo(1);
}

Output:
analyzer 1.20.0-dev.10.0 strong mode:
No issues found
analyzer 1.20.0-dev.10.0 nostrong mode:
[warning] Parameters cannot override default values, this method overrides 'A.foo' where this positional parameter has a different value
analyzer 1.19.1 strong mode:
[error] Parameters cannot override default values, this method overrides 'A.foo' where this positional parameter has a different value

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onlanguage-strong-mode-polishlegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions