dart-sdk/tests/language_2/regress_31279_test.dart
Régis Crelier 87ff74f2d3 [VM] Fix parsing of 'covariant' followed by 'void' and look-ahead parsing of
type argument starting with 'void' (fixes #31279).
Add regression test.

Change-Id: I590e6ce0e7e915098cb24e91db9c1c8549606208
Reviewed-on: https://dart-review.googlesource.com/24624
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-11-29 22:32:35 +00:00

23 lines
680 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.
abstract class Base {
void update(void Function(Iterable) updates);
void update2(void updates(Iterable iterable));
}
class CovariantParsingIssue implements Base {
void update(covariant void Function(List) updates) {}
void update2(covariant void updates(List list)) {}
}
void VoidParsingIssue() {
List<void Function(int)> functions = [(int i) => print(i + 1)];
functions[0](42);
}
void main() {
new CovariantParsingIssue();
VoidParsingIssue();
}