Files
sdk/tests/language_2/vm/regress_39283_test.dart
T
Alexander Markov fa43799461 [vm/bytecode] Check number of type arguments in non-generic closures
Fixes https://github.com/dart-lang/sdk/issues/39283

Change-Id: I5a5fdf158c6a7ce068be36754ea0487cb754584b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124470
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-11-08 17:16:37 +00:00

23 lines
484 B
Dart

// Copyright (c) 2019, 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 {
dynamic foo(a) {
baz() {
Expect.fail('Should not be reachable');
}
return baz;
}
}
main() {
Expect.throws(() {
dynamic x = A().foo(1);
x<List>();
}, (e) => e is NoSuchMethodError);
}