Skip to content

[CFE] No error in CFE if an extension type is not well-bounded #54097

Closed
@sgrekhov

Description

@sgrekhov

The following program produces an expected error in analyzer but not in CFE

// SharedOptions=--enable-experiment=inline-class

extension type V<T extends V<T>>(T id) {}
//                         ^
// [analyzer] unspecified
// [cfe] unspecified

main() {
  print(V<Never>);
}

After extension type erasure we'll have here extension type V<T extends T>(T id) {} which is an error. So, analyzer correctly expects COMPILE_TIME_ERROR.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND here

Tested on Dart SDK version: 3.3.0-edge.5918e012cc875df2b96ec25e3fee0de263feed80 (main) (Mon Nov 20 08:03:39 2023 +0000) on "linux_x64"

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions