blob: 2d66c196819bd22f4bd268367891db03e9940cb9 [file] [log] [blame]
// Copyright (c) 2014, 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 Point<T> operator +(Point<T> other)
/// @description Checks that if at least one of coordinates is null,
/// an Exception is thrown.
/// @author kaigorodov
import "dart:math";
main() {
new Point(0, 0) - new Point(1, null);
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
// [cfe] The value 'null' can't be assigned to the parameter type 'int' because 'int' is not nullable.
new Point(0, 0) - new Point(null, 1);
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
// [cfe] The value 'null' can't be assigned to the parameter type 'int' because 'int' is not nullable.
new Point(0, null) - new Point(1, 1);
// ^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new Point(null, 0) - new Point(1, 1);
// ^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}