blob: d1bb8ee461af7d303c024424aa5dfb8e518debe0 [file] [log] [blame]
library test;
import self as self;
import "dart:core" as core;
class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t;
constructor •(self::C::T t) void
: self::C::t = t, super core::Object::•()
;
}
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 let final core::double #t2 = #t1.{self::C::t} = 1.0 in #t1;
self::C<dynamic> c_dynamic = new self::C::•<dynamic>(42);
x.{self::C::t} = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart:26:56: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x. /*@target=C::t*/ t = /*error:INVALID_ASSIGNMENT*/ 'hello';
^" in let final core::String #t4 = "hello" in null;
}
static method main() → dynamic {}