blob: e0f574c2d71c03fb24bc4c0f8f5a3e9a51426910 [file] [log] [blame]
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static field (core::int) core::int implicitInstantiation = #C1<core::int>;
static const field (core::int) core::int implicitConstInstantiation = #C2;
static method id<T extends core::Object? = dynamic>(self::id::T% t) self::id::T%
return t;
static method create<T extends core::Object? = dynamic>() (self::create::T%) self::create::T%
return #C1<self::create::T%>;
static method main() dynamic {
self::expect(true, core::identical(self::implicitInstantiation, self::implicitInstantiation));
self::expect(false, core::identical(self::implicitInstantiation, #C2));
self::expect(false, core::identical(self::implicitInstantiation, self::create<core::int>()));
self::expect(false, core::identical(#C2, self::implicitInstantiation));
self::expect(true, core::identical(#C2, #C2));
self::expect(false, core::identical(#C2, self::create<core::int>()));
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!(expected =={core::Object::==}{(core::Object) core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = tearoff self::id
#C2 = partial-instantiation self::id <core::int*>
}
Extra constant evaluation status:
Evaluated: StaticInvocation @ org-dartlang-testcase:///identical_instantiated_function_tearoffs.dart:28:13 -> BoolConstant(true)
Evaluated: Instantiation @ org-dartlang-testcase:///identical_instantiated_function_tearoffs.dart:16:43 -> InstantiationConstant(id<int*>)
Extra constant evaluation: evaluated: 30, effectively constant: 2