Skip to content

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

Closed
@eernstg

Description

@eernstg

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

legacy-area-front-endLegacy: Use area-dart-model instead.type-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

      Participants

      @chloestefantsova@eernstg

      Issue actions

        [cfe] Should not report a compile-time error on `final` super parameter · Issue #48714 · dart-lang/sdk