blob: 31df48467a49a0d78713e5b523b9f41a487b3425 [file] [log] [blame]
// Copyright (c) 2016, 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 The static type of an additive expression is usually determined
/// by the signature given in the declaration of the operator used. However,
/// invocations of the operators + and - of class int are treated specially
/// by the typechecker.
/// The static type of an expression e1 + e2 where e1 has static type int is
/// int if the static type of e2 is int, and double if the static type of e2 is
/// double.
/// The static type of an expression e1 - e2 where e1 has static type int is
/// int if the static type of e2 is int, and double if the static type of e2 is
/// double.
/// @description Checks different cases for static types of x + y, x - y when
/// arguments are int or double.
/// @author ngl@unipro.ru
main() {
int i1 = 1 + 1;
double d2 = 1 + 1.2;
double d3 = 1.2 + 1;
double d4 = 1.2 + 1.2;
}