blob: 44db46c211c4bba204338486163164501ba31be9 [file] [log] [blame]
// Copyright (c) 2011, 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.
/**
* @assertion An expression of the form op e is equivalent to the method
* invocation e.op().
* @description Checks that an expression of the form ~ e is equivalent to the
* method invocation e.operator~().
* @author msyabro
*/
import '../../../Utils/expect.dart';
class TestException {}
class A {
operator ~() {
throw new TestException();
}
}
main() {
A a = new A();
try {
~a;
Expect.fail("Operator ~ was not called");
} on TestException catch (e) {}
}