-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
cfe-feature-extension-typesImplement extension types feature in the CFEImplement extension types feature in the CFEfront-end-missing-errorlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.
Description
Extension types specification was recently updated and now contains the following
A compile-time error occurs if a type variable declared by DV occurs in a non-covariant position in V1.
But there is no such error in CFE (presents in analyzer)
// SharedOptions=--enable-experiment=inline-class
class A<T> {}
// Analyzer: 'T' can't be used contravariantly or invariantly in 'A<void Function(T)>'. Try not using class type parameters
// in types of formal parameters of function types, nor in explicitly contravariant or invariant superinterfaces.
// CFE: no expected error
extension type ET<T>(A<Never> _) implements A<void Function(T)> {}
// ^^
// [analyzer] unspecified
// [cfe] unspecified
main() {
print(ET);
}
Tested on Dart SDK version: 3.3.0-edge.e285a5724831d547f03d34764c0c08de998548db (be) (Thu Oct 19 03:46:18 2023 +0000) on "linux_x64"
Metadata
Metadata
Assignees
Labels
cfe-feature-extension-typesImplement extension types feature in the CFEImplement extension types feature in the CFEfront-end-missing-errorlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.