Files
sdk/pkg/front_end/testcases/general/constants/js_semantics/issue45376.dart.weak.expect
T
Johnni Winther 57f18c6d38 [cfe] Add tests for issue 45376
These tests show that we handle >> and >>> similarly wrt to allowing
integer operations on double constants with integer values.

https://github.com/dart-lang/sdk/issues/45438 proposes to disallow these,
but that requires a new js evaluation strategy and the issue in 45376
is therefore just a consequence of the current approach.

Change-Id: I703b57d5a6562ff1c1410858b22a96655f59dc4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193406
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-30 10:25:08 +00:00

21 lines
786 B
Plaintext

library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
class MyClass extends core::Object /*hasConstConstructor*/ {
final field core::int a;
final field core::int b;
const constructor •(dynamic i1, dynamic i2) → self::MyClass
: self::MyClass::a = i1{dynamic}.>>>(i2) as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, self::MyClass::b = i1{dynamic}.>>>(i2) as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, super core::Object::•()
;
}
static method test() → dynamic {}
static method main() → dynamic {}
Constructor coverage from constants:
org-dartlang-testcase:///issue45376.dart:
- MyClass. (from org-dartlang-testcase:///issue45376.dart:8:9)
- Object. (from org-dartlang-sdk:///lib/core/object.dart:25:9)