-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failuresfront-end-missing-errorlanguage-nonfunction-type-aliasesIssues related to non-function type aliasesIssues related to non-function type aliaseslegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone
Description
Dart VM version: 2.9.0-18.0.dev (dev) (Mon Jun 22 16:07:30 2020 +0200) on "windows_x64"
The following source code example declares a A<num?> variable for typedef A<X extends num>
class C<X> {}
typedef A<X extends num> = C<X?>;
main() {
A<num?>? aaa = throw "Here is me";
}Num? is not assignable to num, so compile error should be thrown here. However, dart does not throw it.
Sample output is:
$> dart --enable-experiment=nonfunction-type-aliases,non-nullable test.dart
Unhandled exception:
Here is me
#0 main (file:///D:/DART/sdk/tests/co19/src/LanguageFeatures/Simple-bounds/static/type-aliases/test.dart:5:18)
#1 _startIsolate. (dart:isolate-patch/isolate_patch.dart:301:19)
#2 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Metadata
Metadata
Assignees
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failuresfront-end-missing-errorlanguage-nonfunction-type-aliasesIssues related to non-function type aliasesIssues related to non-function type aliaseslegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)