blob: 184f2916d0ba9996d8812acb16c4a0423250aa43 [file] [log] [blame]
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
import "type_parameter_nullability_lib.dart" as typ;
import "org-dartlang-testcase:///type_parameter_nullability_lib.dart";
class C<T extends core::num?, S extends core::Object? = dynamic, U extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() self::C<self::C::T%, self::C::S%, self::C::U%>
: super core::Object::•()
;
method promoteNullable(generic-covariant-impl self::C::T? t) void {
if(t is{ForNonNullableByDefault} core::int) {
t{self::C::T? & core::int /* '?' & '!' = '!' */};
}
if(t is{ForNonNullableByDefault} core::int?) {
t{self::C::T? & core::int? /* '?' & '?' = '?' */};
}
}
method nullableAsUndetermined(generic-covariant-impl self::C::S? s) void {
s as{ForNonNullableByDefault} self::C::U%;
}
}
static method main() dynamic {
self::C<core::num, core::num, core::num> c = new self::C::•<core::num, core::num, core::num>();
c.{self::C::promoteNullable}(null){(core::num?) void};
c.{self::C::promoteNullable}(0){(core::num?) void};
c.{self::C::nullableAsUndetermined}(null){(core::num?) void};
c.{self::C::nullableAsUndetermined}(0){(core::num?) void};
typ::D<core::num> d = new typ::D::•<core::num>();
d.{typ::D::promoteLegacy}(null){(core::num*) →* void};
d.{typ::D::promoteLegacy}(0){(core::num*) →* void};
}
library;
import self as typ;
import "dart:core" as core;
class D<T extends core::num*> extends core::Object {
synthetic constructor •() typ::D<typ::D::T*>*
: super core::Object::•()
;
method promoteLegacy(generic-covariant-impl typ::D::T* t) void {
if(t is core::int*) {
let final typ::D::T* & core::int* /* '*' & '*' = '*' */ #t1 = t{typ::D::T* & core::int* /* '*' & '*' = '*' */} in #t1 == null ?{core::bool*} null : #t1.{core::int::isEven}{core::bool*};
}
}
abstract member-signature get _identityHashCode() core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) core::bool*; -> core::Object::==
abstract member-signature get hashCode() core::int*; -> core::Object::hashCode
abstract member-signature method toString() core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() core::Type*; -> core::Object::runtimeType
}