blob: a9a4a29101fbea52ee563fbbd799b22187cfbfac [file] [log] [blame]
library test;
import self as self;
import "dart:core" as core;
class A extends core::Object {
field core::int x = 0;
field core::int y = null;
final field core::int z = 42;
synthetic constructor •() void
: super core::Object::•()
;
method test1() dynamic {
core::int a = this.{self::A::x};
a = let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:13:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.\n a = /*error:INVALID_ASSIGNMENT*/ \"hi\";\n ^";
a = 3;
core::int b = this.{self::A::y};
b = let final dynamic #t2 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:16:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.\n b = /*error:INVALID_ASSIGNMENT*/ \"hi\";\n ^";
b = 4;
core::int c = this.{self::A::z};
c = let final dynamic #t3 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:19:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.\n c = /*error:INVALID_ASSIGNMENT*/ \"hi\";\n ^";
c = 4;
}
}
static method main() dynamic {}