-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjusted Dart.g to contain the grammar updates of language repo PR 293
This CL makes several adjustments to the spec_parser grammar Dart.g, such that the spec_parser can parse the proposed NNBD constructs, cf. language PR #293. Change-Id: Ieec00259d73b6037d6a87d5c97cfac40186baef0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101500 Reviewed-by: Leaf Petersen <[email protected]> Commit-Queue: Erik Ernst <[email protected]>
- Loading branch information
1 parent
76c99bc
commit a580529
Showing
11 changed files
with
166 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
tests/language_2/nnbd/syntax/class_member_declarations_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// 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. | ||
|
||
// SharedOptions=--enable-experiment=non-nullable | ||
|
||
class A { | ||
static late x1; //# 01: syntax error | ||
static late final x2; | ||
static late int x3; | ||
static late final A x4; | ||
static late x5 = 0; //# 02: syntax error | ||
static late final x6 = 0; | ||
static late int x7 = 0; | ||
static late final A? x8 = null; | ||
|
||
static final late x9; //# 03: syntax error | ||
static final late A x10; //# 04: syntax error | ||
static final late x11 = 0; //# 05: syntax error | ||
static final late A x12 = null; //# 06: syntax error | ||
|
||
covariant late var x13; | ||
covariant late var x14 = ''; | ||
covariant late x15; //# 07: syntax error | ||
covariant late x16 = ''; //# 08: syntax error | ||
|
||
late covariant var x17; //# 09: syntax error | ||
late covariant var x18 = ''; //# 10: syntax error | ||
late covariant x19; //# 11: syntax error | ||
late covariant x20 = ''; //# 12: syntax error | ||
|
||
covariant var late x21; //# 13: syntax error | ||
covariant var late x22 = ''; //# 14: syntax error | ||
|
||
covariant late double x23; | ||
covariant late String x24 = ''; | ||
|
||
covariant double late x23; //# 15: syntax error | ||
covariant String late x24 = ''; //# 16: syntax error | ||
|
||
late x25; //# 17: syntax error | ||
late final x26; | ||
late int x27; | ||
late final A x28; | ||
late x29 = 0; //# 18: syntax error | ||
late final x30 = 0; | ||
late int x31 = 0; | ||
late final A? x32 = null; | ||
|
||
final late x33; //# 19: syntax error | ||
int late x34; //# 20: syntax error | ||
var late x35; //# 21: syntax error | ||
final late A x36; //# 22: syntax error | ||
final late x37 = 0; //# 23: syntax error | ||
int late x38 = 0; //# 24: syntax error | ||
var late x39 = 0; //# 25: syntax error | ||
final late A? x40 = null; //# 26: syntax error | ||
|
||
List foo() { | ||
final x41 = true; | ||
late final x42; | ||
late final x43 = [], x44 = {}; | ||
return x43; | ||
} | ||
} | ||
|
||
abstract class B { | ||
m1(int some, regular, covariant parameters, { | ||
required p1, | ||
// required p2 = null, // Likely intended to be an error. | ||
required covariant p3, | ||
required covariant int p4, | ||
}); | ||
} | ||
|
||
main() { | ||
A? a; | ||
String? s = ''; | ||
a?..foo().length..x27 = s!..toString().length; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.