mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
4948c31b7a
+ some test expectation fixes Change-Id: Ibf0259914960ea25978f2b8e29aa89336e209f2f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162321 Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
23 lines
891 B
Dart
23 lines
891 B
Dart
// 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.
|
|
// Dart version of two-argument Ackermann-Peter function.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
main() {
|
|
try {
|
|
print("abcdef".substring(1.5, 3.5));
|
|
// ^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
|
|
// [cfe] The argument type 'double' can't be assigned to the parameter type 'int'.
|
|
// ^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
|
|
// [cfe] The argument type 'double' can't be assigned to the parameter type 'int?'.
|
|
Expect.fail("Should have thrown an exception");
|
|
} on TypeError catch (e) {
|
|
// OK.
|
|
} on ArgumentError catch (e) {
|
|
// OK.
|
|
}
|
|
}
|