mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:56:57 +00:00
bc9645509e
This un-revert fixes the issues revealed in https://logs.chromium.org/v/?s=chromium%2Fbb%2Fclient.dart%2Fvm-kernel-mac-release-x64-be%2F2217%2F%2B%2Frecipes%2Fsteps%2Fvm_tests%2F0%2Fstdout.
Patchset 1 contains the original revision unmodified.
This reverts commit 9029ee09c5
.
Bug:
Change-Id: I109c011c2688144b00293ce50b3aad53e018a2f2
Reviewed-on: https://dart-review.googlesource.com/18340
Reviewed-by: Régis Crelier <regis@google.com>
33 lines
1,017 B
Dart
33 lines
1,017 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.
|
|
// VMOptions=--reify-generic-functions --optimization-counter-threshold=10 --no-use-osr --no-background-compilation
|
|
|
|
library generic_no_such_method_dispatcher_test_simple;
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
// A simple test that noSuchMethod dispatching works correctly with generic
|
|
// functions. We will remove this once the more complex version of this test
|
|
// 'generic_no_such_method_dispatcher_test' can be compiled by Fasta.
|
|
|
|
class A {}
|
|
|
|
class B extends A {
|
|
foo() => super.foo<int>();
|
|
}
|
|
|
|
test(fn) {
|
|
try {
|
|
fn();
|
|
} catch (e) {
|
|
Expect.isTrue(e.toString().contains("foo<int>"));
|
|
}
|
|
}
|
|
|
|
main() {
|
|
test(() => (new B()).foo()); // missing generic super call
|
|
test(() => foo<int>()); // missing generic static call
|
|
test(() => (new A()).foo<int>()); // missing generic method call
|
|
}
|