blob: d5508f08a85bcad19e7dbd2c95f0f45618b56728 [file] [log] [blame]
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart:26:55: Error: A value of type 'String' can't be assigned to a variable of type 'int'.
// x. /*@target=C.t*/ t = /*error:INVALID_ASSIGNMENT*/ 'hello';
// ^
//
import self as self;
import "dart:core" as core;
class C<T extends core::Object* = dynamic> extends core::Object {
generic-covariant-impl field self::C::T* t;
constructor •(self::C::T* t) self::C<self::C::T*>*
: self::C::t = t, super core::Object::•()
;
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
}
static method test() dynamic {
self::C<core::int*>* x = new self::C::•<core::int*>(42);
core::num* y;
self::C<core::int*>* c_int = new self::C::•<core::int*>(y as{TypeError} core::int*);
self::C<core::num*>* c_num = new self::C::•<core::num*>(123);
self::C<core::num*>* c_num2 = let final self::C<core::num*>* #t1 = new self::C::•<core::num*>(456) in block {
#t1.{self::C::t} = 1.0;
} =>#t1;
self::C<dynamic>* c_dynamic = new self::C::•<dynamic>(42);
x.{self::C::t} = let final Never* #t2 = invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart:26:55: Error: A value of type 'String' can't be assigned to a variable of type 'int'.
x. /*@target=C.t*/ t = /*error:INVALID_ASSIGNMENT*/ 'hello';
^" in "hello" as{TypeError} core::int*;
}
static method main() → dynamic {}