Skip to content

[cfe] Should not report a compile-time error on final super parameter #48714

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
eernstg opened this issue Mar 31, 2022 · 0 comments
Closed

[cfe] Should not report a compile-time error on final super parameter #48714

eernstg opened this issue Mar 31, 2022 · 0 comments
Assignees
Labels
legacy-area-front-end Legacy: Use area-dart-model instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@eernstg
Copy link
Member

eernstg commented Mar 31, 2022

Cf. #48699. Consider the following program:

class Base {
  int value;
  Base(this.value);
}

class Extended extends Base {
  Extended(final super.value);
}

This program gives rise to a compile-time error with the current CFE, commit ac19f52:

n028.dart:7:5: Error: Can't have modifier 'final' here.
Try removing 'final'.
  B(final super.x);
    ^^^^^

However, I cannot find any rules against having the modifier final on a super parameter. It is final already, but it should be benign to specify it explicitly as well.

The behavior seems to have been introduced quite recently, it does not occur with a dart from 2.17.0-212.0.dev.

@eernstg eernstg added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) legacy-area-front-end Legacy: Use area-dart-model instead. labels Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-front-end Legacy: Use area-dart-model instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants