Skip to content

Commit 0f08aab

Browse files
creliercommit-bot@chromium.org
authored andcommitted
[VM parser] Fix look-ahead parsing of void as type argument.
This is part of implementing generalized void, see #30516. Add regression test. Update status files. Change-Id: I0b4730734238b4dc463ddd7835e30ea8a2bd4300 Bug: Reviewed-on: https://dart-review.googlesource.com/34224 Commit-Queue: Régis Crelier <[email protected]> Reviewed-by: Siva Annamalai <[email protected]>
1 parent cc76549 commit 0f08aab

9 files changed

+22
-3
lines changed

runtime/vm/parser.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8359,9 +8359,6 @@ bool Parser::TryParseTypeArguments() {
83598359
nesting_level -= 2;
83608360
} else if (ct == Token::kVOID) {
83618361
ConsumeToken();
8362-
if (!IsFunctionTypeSymbol()) {
8363-
return false;
8364-
}
83658362
continue;
83668363
} else if (ct == Token::kIDENT) {
83678364
if (IsFunctionTypeSymbol()) {

tests/co19/co19-kernel.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ Language/Statements/Yield_and_Yield_Each/Yield_Each/location_t01: MissingCompile
204204
Language/Statements/Yield_and_Yield_Each/Yield_Each/location_t03: MissingCompileTimeError # Issue 25495
205205
Language/Statements/Yield_and_Yield_Each/Yield_Each/location_t05: MissingCompileTimeError # Issue 25495
206206
Language/Types/Static_Types/deferred_type_t01: RuntimeError # Kernel Issue 28335 (deferred libraries)
207+
Language/Types/Type_Void/syntax_t01: Pass # Issue 30470
207208
Language/Variables/final_or_static_initialization_t02: MissingCompileTimeError
208209
Language/Variables/final_or_static_initialization_t03: MissingCompileTimeError
209210
LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01: Skip # No support for deferred libraries.

tests/co19/co19-runtime.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t08: Runtime
292292
Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t09: RuntimeError # Issue 25748
293293
Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t10: RuntimeError # Issue 25748
294294
Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_sync_t05: RuntimeError # Issue 25662,25634
295+
Language/Types/Type_Void/syntax_t01: MissingCompileTimeError # Issue co19/30264
295296
LayoutTests/fast/*: SkipByDesign # DOM not supported on VM.
296297
LibTest/collection/ListBase/ListBase_class_A01_t01: RuntimeError # Large integers
297298
LibTest/collection/ListMixin/ListMixin_class_A01_t01: RuntimeError # Large integers

tests/language_2/language_2_dart2js.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ regress_23089_test: MissingCompileTimeError
595595
regress_23408_test: RuntimeError
596596
regress_26133_test: MissingCompileTimeError
597597
regress_27572_test: MissingCompileTimeError
598+
regress_30516_test: CompileTimeError # Issue 30515.
598599
regress_31057_test: RuntimeError
599600
regress_31591_test: RuntimeError, OK # strong mode only
600601
return_type_test: MissingCompileTimeError

tests/language_2/language_2_dartdevc.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ regress_29405_test: CompileTimeError # Issue 31402 Error: A value of type '#lib2
597597
regress_29784_test/01: MissingCompileTimeError
598598
regress_29784_test/02: MissingCompileTimeError
599599
regress_30339_test: CompileTimeError
600+
regress_30516_test: CompileTimeError # Issue 30470.
600601
setter4_test: MissingCompileTimeError
601602
setter_no_getter_test/01: CompileTimeError
602603
setter_override_test/00: MissingCompileTimeError

tests/language_2/language_2_kernel.status

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ regress_29405_test: CompileTimeError # Issue 31402 (Invocation arguments)
676676
regress_29784_test/01: MissingCompileTimeError
677677
regress_29784_test/02: MissingCompileTimeError
678678
regress_30339_test: CompileTimeError # Issue 31402 (Variable declaration)
679+
regress_30516_test: CompileTimeError # Issue 30470.
679680
setter4_test: MissingCompileTimeError # Issue 14736
680681
setter_override_test/01: MissingCompileTimeError
681682
setter_override_test/02: MissingCompileTimeError
@@ -707,6 +708,7 @@ syntax_test/30: MissingCompileTimeError
707708
syntax_test/31: MissingCompileTimeError
708709
syntax_test/32: MissingCompileTimeError
709710
syntax_test/33: MissingCompileTimeError
711+
syntax_test/59: Pass # Issue 30470.
710712
type_literal_test: RuntimeError
711713
type_promotion_functions_test/02: CompileTimeError # Issue 31537
712714
type_promotion_functions_test/03: CompileTimeError # Issue 31537
@@ -1541,6 +1543,7 @@ regress_29405_test: CompileTimeError # Issue 31402 (Invocation arguments)
15411543
regress_29784_test/01: MissingCompileTimeError
15421544
regress_29784_test/02: MissingCompileTimeError
15431545
regress_30339_test: CompileTimeError # Issue 31402 (Variable declaration)
1546+
regress_30516_test: CompileTimeError # Issue 30470.
15441547
setter4_test: MissingCompileTimeError # Issue 14736
15451548
setter_no_getter_test/01: Pass, CompileTimeError # Issue 31533 (started passing after switching to batch-mode)
15461549
setter_override_test/01: MissingCompileTimeError
@@ -1575,6 +1578,7 @@ syntax_test/30: MissingCompileTimeError
15751578
syntax_test/31: MissingCompileTimeError
15761579
syntax_test/32: MissingCompileTimeError
15771580
syntax_test/33: MissingCompileTimeError
1581+
syntax_test/59: Pass # Issue 30470.
15781582
type_literal_test: RuntimeError
15791583
type_promotion_functions_test/02: CompileTimeError # Issue 31537
15801584
type_promotion_functions_test/03: CompileTimeError # Issue 31537

tests/language_2/language_2_precompiled.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ super_test: Fail, OK
878878
switch_fallthru_test/01: MissingCompileTimeError
879879
symbol_literal_test/01: MissingCompileTimeError
880880
sync_generator1_test/01: MissingCompileTimeError
881+
syntax_test/59: MissingCompileTimeError,OK # Issue 30516.
881882
top_level_getter_no_setter1_test: MissingCompileTimeError
882883
top_level_getter_no_setter2_test: MissingCompileTimeError
883884
transitive_private_library_access_test: MissingCompileTimeError

tests/language_2/language_2_vm.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,7 @@ super_operator_index_test/07: MissingCompileTimeError
834834
switch_fallthru_test/01: MissingCompileTimeError
835835
symbol_literal_test/01: MissingCompileTimeError
836836
sync_generator1_test/01: MissingCompileTimeError
837+
syntax_test/59: MissingCompileTimeError,OK # Issue 30516.
837838
top_level_getter_no_setter1_test: MissingCompileTimeError
838839
top_level_getter_no_setter2_test: MissingCompileTimeError
839840
transitive_private_library_access_test: MissingCompileTimeError
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
typedef void RecognizerCallback<T>();
6+
typedef void GestureTapCancelCallback();
7+
GestureTapCancelCallback onTapCancel;
8+
T invokeCallback<T>(String name, RecognizerCallback<T> callback,
9+
{String debugReport()}) {}
10+
main() {
11+
invokeCallback<void>('spontaneous onTapCancel', onTapCancel);
12+
}

0 commit comments

Comments
 (0)