c191551fac
TEST=Covered by existing tests. Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
54 lines
3.0 KiB
Plaintext
54 lines
3.0 KiB
Plaintext
library;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/general/invalid_assignment.dart:11:7: Error: A value of type 'String' can't be assigned to a variable of type 'int'.
|
|
// i = s;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/general/invalid_assignment.dart:13:9: Error: A value of type 'String' can't be assigned to a variable of type 'int'.
|
|
// i ??= s;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/general/invalid_assignment.dart:15:5: Error: A value of type 'String' can't be assigned to a variable of type 'A'.
|
|
// - 'A' is from 'pkg/front_end/testcases/general/invalid_assignment.dart'.
|
|
// a += 1;
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class A extends core::Object {
|
|
synthetic constructor •() → self::A*
|
|
: super core::Object::•()
|
|
;
|
|
operator +(core::int* i) → core::String*
|
|
return "";
|
|
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(core::int* i, core::String* s, self::A* a) → dynamic {
|
|
i = 1;
|
|
i = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/invalid_assignment.dart:11:7: Error: A value of type 'String' can't be assigned to a variable of type 'int'.
|
|
i = s;
|
|
^" in s as{TypeError} core::int*;
|
|
i.{core::num::==}(null) ?{core::int*} i = 1 : null;
|
|
i.{core::num::==}(null) ?{core::Object*} i = let final Never* #t2 = invalid-expression "pkg/front_end/testcases/general/invalid_assignment.dart:13:9: Error: A value of type 'String' can't be assigned to a variable of type 'int'.
|
|
i ??= s;
|
|
^" in s as{TypeError} core::int* : null;
|
|
a = new self::A::•();
|
|
a = let final Never* #t3 = invalid-expression "pkg/front_end/testcases/general/invalid_assignment.dart:15:5: Error: A value of type 'String' can't be assigned to a variable of type 'A'.
|
|
- 'A' is from 'pkg/front_end/testcases/general/invalid_assignment.dart'.
|
|
a += 1;
|
|
^" in a.{self::A::+}(1) as{TypeError} self::A*;
|
|
}
|
|
static method main() → dynamic {}
|