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

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

Closed
sgrekhov opened this issue Sep 29, 2016 · 4 comments
Closed

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

sgrekhov opened this issue Sep 29, 2016 · 4 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on soundness type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sgrekhov
Copy link
Contributor

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

@bwilkerson bwilkerson added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-strong-mode P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Sep 29, 2016
@bwilkerson
Copy link
Member

My understanding is that strong mode is going to be relaxed to allow field overriding, so this might become a non-issue.

@jmesserly
Copy link

My understanding is that strong mode is going to be relaxed to allow field overriding, so this might become a non-issue.

whatever the default, we still need something to indicate fields are sealed, though. So this bug is important to get fixed.

@munificent munificent changed the title Dartalalyzer allows fields override in a strong mode for mixins Dartanalyzer allows fields override in a strong mode for mixins Oct 5, 2016
@jmesserly
Copy link

merging this into #27502 (comment)

@jmesserly
Copy link

Digging deeper, this appears more serious than I thought and affects much more than fields. I've filed: #29426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on soundness type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants