blob: d9fd621f2266b4790d0274670047bd2104852a62 [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 Unary expressions invoke unary operators on objects.
* unaryExpression:
* prefixOperator unaryExpression |
* postfixExpression |
* (minusOperator | tildeOperator) super |
* incrementOperator assignableExpression
* ;
* prefixOperator:
* minusOperator |
* negationOperator |
* tildeOperator
* ;
* minusOperator:
* ‘-’ |
* ;
* negationOperator:
* ‘!’ |
* ;
* tildeOperator:
* ‘˜’
* ;
* @description Checks that incrementOperator can't be used with super
* @compile-error
* @author msyabro
* @reviewer kaigorodov
* @reviewer rodionov
*/
class S {}
class A extends S {
test() {
try {
++super;
} catch(e) {}
}
}
main() {
A a = new A();
a.test();
}