fdc765faad
TEST=existing Change-Id: I0a8fdf09f742b55357411f12dc6164d4050bb83c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196283 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
26 lines
870 B
Plaintext
26 lines
870 B
Plaintext
library /*isNonNullableByDefault*/;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
extension E<T extends core::Object? = dynamic> on T% {
|
|
get f = self::E|get#f;
|
|
}
|
|
static method E|get#f<T extends core::Object? = dynamic>(lowered final self::E|get#f::T% #this) → (self::E|get#f::T%) → self::E|get#f::T%
|
|
return (self::E|get#f::T% t) → self::E|get#f::T% => t;
|
|
static method method1<S extends core::Object? = dynamic>(self::method1::S% s) → dynamic {
|
|
(self::method1::S%) → self::method1::S% f = self::E|get#f<self::method1::S%>(s);
|
|
}
|
|
static method method2<S extends dynamic>(self::method2::S% s) → dynamic {
|
|
self::throws(() → void => s.f);
|
|
}
|
|
static method main() → dynamic {}
|
|
static method throws(() → void f) → dynamic {
|
|
try {
|
|
f.call();
|
|
}
|
|
on core::Object catch(final core::Object e) {
|
|
return;
|
|
}
|
|
throw "Expected exception";
|
|
}
|