Skip to content

Dartanalyzer allows fields override in a strong mode for mixins #27452

Closed
@sgrekhov

Description

@sgrekhov

In a strong mode it is prohibited to override fields. Therefore Analyzer in a strong mode reports an error for the following code

class A {
  int x = 0;
}
class M {
  int x = 1;
}
class C extends A with M {
}
main() {
}

Analyzer output in this case is

[error] Field declaration A.x cannot be overridden in M.

But it doesn't report any issues for the following code

class A {
  int x = 0;
}
class M {
  int x = 1;
}
class C = A with M;
main() {
}

It should be the same error in the case above.
Tested on dartanalyzer version 1.20.0-dev.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions