dart-sdk/tests/language_2/implicit_downcast_during_invocation_test.dart
Paul Berry 8cdd9d323c Insert implicit downcast checks for invocation arguments.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: I1fa7490f6143bd6ceca80f831e0196b16c497966
Reviewed-on: https://dart-review.googlesource.com/20907
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-21 00:17:37 +00:00

21 lines
420 B
Dart

// Copyright (c) 2017, 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.
import "package:expect/expect.dart";
class A {}
class B extends A {}
void f(B b) {}
main() {
A a1 = new B();
A a2 = new A();
f(a1); // No error
Expect.throwsTypeError(() {
f(a2);
});
}