blob: 4744015df3f813b8a059b753d720662aeeba9ff9 [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 |
/// awaitExpression |
/// postfixExpression |
/// (minusOperator | tildeOperator) super |
/// incrementOperator assignableExpression
/// ;
/// prefixOperator:
/// minusOperator |
/// negationOperator |
/// tildeOperator
/// ;
/// minusOperator:
/// ‘-’ |
/// ;
/// negationOperator:
/// ‘!’ |
/// ;
/// tildeOperator:
/// ‘˜’
/// ;
/// A unary expression is either a postfix expression, an await expression or
/// an invocation of a prefix operator on an expression or an invocation of a
/// unary operator on either super or an expression e.
/// @description Checks that it's a compile-time error when a '!'
/// precedes a statement that isn't an expression (block statement).
/// @author msyabro
main() {
!{int? x; x = 1;};
// ^
// [analyzer] unspecified
// [cfe] unspecified
}