Skip to content

Analyzer doesn't forward const constructors #38305

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

Closed
fishythefish opened this issue Sep 10, 2019 · 3 comments
Closed

Analyzer doesn't forward const constructors #38305

fishythefish opened this issue Sep 10, 2019 · 3 comments
Labels
analyzer-constants dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@fishythefish
Copy link
Member

See #32223.

class Mixin {}

class Base {
  const Base();
}

class Sub = Base with Mixin;

void main() {
  const Sub();
}

Analyzer incorrectly produces an error: The constructor being called isn't a const constructor.

@fishythefish fishythefish added legacy-area-analyzer Use area-devexp instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Sep 10, 2019
@scheglov
Copy link
Contributor

scheglov commented Jan 5, 2020

I have issues with understanding the spec wording, asked for clarification.

@srawlins srawlins added dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec analyzer-constants labels Jun 16, 2020
@srawlins srawlins added the P2 A bug or feature request we're likely to work on label Nov 10, 2020
@srawlins
Copy link
Member

Erik responded in that issue.

@eernstg
Copy link
Member

eernstg commented Apr 18, 2023

I think we can close this issue, based on the title. In particular, the analyzer (and the CFE) do create/assume the required forwarding constant constructors, such that the following updated example has no errors:

mixin Mixin {}

class Base {
  const Base();
}

class Sub = Base with Mixin;

void main() {
  const Sub();
}

@srawlins, @scheglov, please reopen the issue or create a new one if you disagree.

@eernstg eernstg closed this as completed Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-constants dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants