| library /*isNonNullableByDefault*/; |
| import self as self; |
| import "dart:core" as core; |
| import "dart:collection" as col; |
| |
| class C<X extends core::Object?, Y extends core::Object> extends core::Object { |
| synthetic constructor •() → self::C<self::C::X%, self::C::Y> |
| : super core::Object::•() |
| ; |
| method test(generic-covariant-impl self::C::X% x, generic-covariant-impl self::C::Y? y) → dynamic { |
| core::Set<core::Object?> v = block { |
| final core::Set<core::Object?> #t1 = col::LinkedHashSet::•<core::Object?>(); |
| #t1.{core::Set::add}(x){(core::Object?) → core::bool}; |
| #t1.{core::Set::add}(42){(core::Object?) → core::bool}; |
| } =>#t1; |
| core::Set<core::Object?> w = block { |
| final core::Set<core::Object?> #t2 = col::LinkedHashSet::•<core::Object?>(); |
| #t2.{core::Set::add}(42){(core::Object?) → core::bool}; |
| #t2.{core::Set::add}(x){(core::Object?) → core::bool}; |
| } =>#t2; |
| core::Set<core::Object?> p = block { |
| final core::Set<core::Object?> #t3 = col::LinkedHashSet::•<core::Object?>(); |
| #t3.{core::Set::add}(y){(core::Object?) → core::bool}; |
| #t3.{core::Set::add}(42){(core::Object?) → core::bool}; |
| } =>#t3; |
| core::Set<core::Object?> q = block { |
| final core::Set<core::Object?> #t4 = col::LinkedHashSet::•<core::Object?>(); |
| #t4.{core::Set::add}(42){(core::Object?) → core::bool}; |
| #t4.{core::Set::add}(y){(core::Object?) → core::bool}; |
| } =>#t4; |
| self::assertRightSubtype(v); |
| self::assertLeftSubtype<core::Set<core::Object?>>(v); |
| self::assertRightSubtype(w); |
| self::assertLeftSubtype<core::Set<core::Object?>>(w); |
| self::assertRightSubtype(p); |
| self::assertLeftSubtype<core::Set<core::Object?>>(p); |
| self::assertRightSubtype(q); |
| self::assertLeftSubtype<core::Set<core::Object?>>(q); |
| if(x is{ForNonNullableByDefault} core::Object?) { |
| core::Set<core::Object?> v = block { |
| final core::Set<core::Object?> #t5 = col::LinkedHashSet::•<core::Object?>(); |
| #t5.{core::Set::add}(x{self::C::X% & core::Object? /* '%' & '?' = '%' */}){(core::Object?) → core::bool}; |
| #t5.{core::Set::add}(42){(core::Object?) → core::bool}; |
| } =>#t5; |
| core::Set<core::Object?> w = block { |
| final core::Set<core::Object?> #t6 = col::LinkedHashSet::•<core::Object?>(); |
| #t6.{core::Set::add}(42){(core::Object?) → core::bool}; |
| #t6.{core::Set::add}(x{self::C::X% & core::Object? /* '%' & '?' = '%' */}){(core::Object?) → core::bool}; |
| } =>#t6; |
| self::assertRightSubtype(v); |
| self::assertLeftSubtype<core::Set<core::Object?>>(v); |
| self::assertRightSubtype(w); |
| self::assertLeftSubtype<core::Set<core::Object?>>(w); |
| } |
| } |
| } |
| static method assertRightSubtype(dynamic x) → dynamic { |
| x as{ForNonNullableByDefault} core::Set<core::Object?>; |
| } |
| static method assertLeftSubtype<X extends core::Object? = dynamic>(self::assertLeftSubtype::X% x) → dynamic { |
| col::LinkedHashSet::•<core::Object?>() as{ForNonNullableByDefault} self::assertLeftSubtype::X%; |
| } |
| static method main() → dynamic { |
| new self::C::•<core::int?, core::int>().{self::C::test}(42, null){(core::int?, core::int?) → dynamic}; |
| new self::C::•<core::int?, core::int>().{self::C::test}(null, null){(core::int?, core::int?) → dynamic}; |
| } |