blob: 4c80d08f80fb7f8cd11aa0ef2cd29ee6177ac54c [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);
// [error line 23, column 0]
// [analyzer] unspecified
// [cfe] unspecified
new Point(null, 0) - new Point(1, 1);
// [error line 27, column 0]
// [analyzer] unspecified
// [cfe] unspecified
}