blob: b738357129363c554914c8de6e024acaf4be7a01 [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 '!' can be used with
* a reference to a type parameter without a compile error.
* @static-warning
* @author msyabro
* @reviewer kaigorodov
* @reviewer rodionov
*/
class A <T> {
test() {
try {
!T; /// static type warning - no such method/operator, see "Ordinary invocation"
} catch(e) {}
}
}
main() {
A a = new A();
a.test();
}