Files
sdk/pkg/front_end/testcases/operator_method_not_found.dart
T
Jens Johansen 8ce2d7a4e1 [CFE] Better error messages on errors with user definable operators
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>
2019-04-02 10:46:18 +00:00

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);
}