8ce2d7a4e1
Fixes #36383 Change-Id: I24fd51bdb3ead75973009fe515819f9c8354e1b0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98332 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Kevin Millikin <kmillikin@google.com>
55 lines
1.1 KiB
Dart
55 lines
1.1 KiB
Dart
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
class Foo {
|
|
}
|
|
|
|
main() {
|
|
Foo foo = new Foo();
|
|
|
|
// Not defined, but given right arity.
|
|
print(foo < 2);
|
|
print(foo > 2);
|
|
print(foo <= 2);
|
|
print(foo >= 2);
|
|
print(foo == 2);
|
|
print(foo - 2);
|
|
print(foo + 2);
|
|
print(foo / 2);
|
|
print(foo ~/ 2);
|
|
print(foo * 2);
|
|
print(foo % 2);
|
|
print(foo | 2);
|
|
print(foo ^ 2);
|
|
print(foo & 2);
|
|
print(foo << 2);
|
|
print(foo >> 2);
|
|
// print(foo >>> 2); // triple shift not enabled by default at the moment.
|
|
print(foo[2] = 2);
|
|
print(foo[2]);
|
|
print(~foo);
|
|
print(-foo);
|
|
|
|
// Not defined, and given wrong arity.
|
|
// Should be binary.
|
|
print(<foo);
|
|
print(>foo);
|
|
print(<=foo);
|
|
print(>=foo);
|
|
print(==foo);
|
|
print(+foo);
|
|
print(/foo);
|
|
print(~/foo);
|
|
print(*foo);
|
|
print(%foo);
|
|
print(|foo);
|
|
print(^foo);
|
|
print(&foo);
|
|
print(<<foo);
|
|
print(>>foo);
|
|
// print(>>>foo); // triple shift not enabled by default at the moment.
|
|
|
|
// Should be unary.
|
|
print(foo ~ 2);
|
|
} |