blob: 3408c21c314a1c6a12fa8b43519b0ca7d54a6eb3 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
inline class I /* declaredRepresentationType = core::int */ {
static factory = self::I|;
static tearoff = self::I|_#new#tearOff;
}
inline class J /* declaredRepresentationType = core::int */ {
static factory = self::J|;
static tearoff = self::J|_#new#tearOff;
constructor _ = self::J|_;
tearoff _ = self::J|_#_#tearOff;
}
inline class K<T extends core::Object? = dynamic> /* declaredRepresentationType = T% */ {
static factory = self::K|;
static tearoff = self::K|_#new#tearOff;
constructor _ = self::K|_;
tearoff _ = self::K|_#_#tearOff;
}
static inline-class-member method I|() self::I
return 0 as self::I;
static inline-class-member method I|_#new#tearOff() → self::I
return self::I|();
static inline-class-member method J|(core::int i) self::J
return self::J|_(i);
static inline-class-member method J|_#new#tearOff(core::int i) → self::J
return self::J|(i);
static inline-class-member method J|_(core::int i) self::J {
lowered final self::J #this = i;
return #this;
}
static inline-class-member method J|_#_#tearOff(core::int i) → self::J
return self::J|_(i);
static inline-class-member method K|<T extends core::Object? = dynamic>(self::K|::T% i) self::K<self::K|::T%>
return self::K|_<self::K|::T%>(i);
static inline-class-member method K|_#new#tearOff<T extends core::Object? = dynamic>(self::K|_#new#tearOff::T% i) → self::K<self::K|_#new#tearOff::T%>
return self::K|<self::K|_#new#tearOff::T%>(i);
static inline-class-member method K|_<T extends core::Object? = dynamic>(self::K|_::T% i) self::K<self::K|_::T%> {
lowered final self::K<self::K|_::T%> #this = i;
return #this;
}
static inline-class-member method K|_#_#tearOff<T extends core::Object? = dynamic>(self::K|_#_#tearOff::T% i) → self::K<self::K|_#_#tearOff::T%>
return self::K|_<self::K|_#_#tearOff::T%>(i);
static method main() dynamic {
self::expect(0, self::I|());
self::expect(0, #C1(){() → self::I});
self::expect(42, self::J|(42));
self::expect(87, self::J|(87));
self::expect(123, #C2(123){(core::int) → self::J});
self::expect("foo", self::K|<core::String>("foo"));
self::expect("bar", self::K|<core::String>("bar"));
self::expect("baz", #C3<core::String>("baz"){(core::String) → self::K<core::String>});
self::expect("boz", #C4("boz"){(core::String) → self::K<core::String>});
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!(expected =={core::Object::==}{(core::Object) core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = static-tearoff self::I|_#new#tearOff
#C2 = static-tearoff self::J|_#new#tearOff
#C3 = static-tearoff self::K|_#new#tearOff
#C4 = instantiation #C3 <core::String*>
}