Non-function type alias bounds checking is incomplete #42446
Labels
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
language-nonfunction-type-aliases
Issues related to non-function type aliases
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
The following tests demonstrate that it is possible to create an instance using a type aliased denotation of a generative constructor where instantiation to bound causes the type arguments to violate the bounds, and no compile-time error is reported:
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Instantiate-to-bound/nonfunction_typedef/static/nonfunction_l1_t03.dart, https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Instantiate-to-bound/nonfunction_typedef/static/nonfunction_l1_t04.dart, https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Instantiate-to-bound/nonfunction_typedef/static/nonfunction_l2_t05.dart, https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Instantiate-to-bound/nonfunction_typedef/static/nonfunction_l2_t06.dart, https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Instantiate-to-bound/nonfunction_typedef/static/nonfunction_l2_t07.dart.
So we must add an extra check that these types are regular-bounded when they have been unaliased to the actual class type.
The text was updated successfully, but these errors were encountered: