Skip to content

[cfe] No error produced for not-implementing-final-classes through legacy libraries. #52115

Closed
@kallentu

Description

@kallentu

Example:

// old_lib.dart
// @dart=2.19

// MapEntry is `final`, but can be implemented due to SDK exception.
class M implements MapEntry<int, int> {
  int get key => 0;
  int get value => 1;
  String toString() => "Bad";
}

and

// new_lib.dart
// @dart=3.0

import "old_lib.dart";

class N implements M {
  int get key => 0;
  int get value => 1;
  String toString() => "Evil";
}

void main() {
  print(N()); // Evil.
}

This gives no errors, or warnings, in the front end.

Analyzer issue for this: #52078

Metadata

Metadata

Assignees

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

Issue actions