36641368bb
This changes ast-to-text to mark legacy libraries instead of non-nullable-by-default libraries. TEST=existing Change-Id: Ib01147e4ef48c2c5b2ffc6b23547998344dfdf2e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307121 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
20 lines
565 B
Plaintext
20 lines
565 B
Plaintext
library /*isLegacy*/;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
static method main() → dynamic {
|
|
core::int* intLocal1;
|
|
core::int* intLocal2;
|
|
core::num* numLocal;
|
|
core::double* doubleLocal;
|
|
intLocal1 = (intLocal2 = numLocal as{TypeError,ForLegacy} core::int*) as{TypeError,ForLegacy} core::int*;
|
|
intLocal1 = numLocal = intLocal2;
|
|
numLocal = 0.5;
|
|
try {
|
|
intLocal1 = (doubleLocal = numLocal as{TypeError,ForLegacy} core::double*) as{TypeError,ForLegacy} core::int*;
|
|
throw "Should fail";
|
|
}
|
|
on dynamic catch(final dynamic _) {
|
|
}
|
|
}
|