[CFE] Textual outline suite doesn't format pre-nnbd sources

Fixes https://github.com/dart-lang/sdk/issues/54328

Change-Id: I6d52d9241f245865d3aba775ea6fe19da4ba7f30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345220
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Jens Johansen 2024-01-08 15:01:26 +00:00 committed by Commit Queue
parent fa8e34e835
commit b52dc18ff8
97 changed files with 477 additions and 1190 deletions

View file

@ -404,21 +404,7 @@ class _ScriptTagChunk extends _TokenChunk {
}
class _UnknownChunk extends _TokenChunk {
final bool addMarkerForUnknownForTest;
_UnknownChunk(
this.addMarkerForUnknownForTest, Token startToken, Token endToken)
: super(startToken, endToken);
@override
void _printOnWithoutHeaderAndMetadata(StringBuffer sb) {
if (addMarkerForUnknownForTest) {
sb.write("---- unknown chunk starts ----\n");
super._printOnWithoutHeaderAndMetadata(sb);
sb.write("\n---- unknown chunk ends ----");
return;
}
super._printOnWithoutHeaderAndMetadata(sb);
}
_UnknownChunk(Token startToken, Token endToken) : super(startToken, endToken);
}
class _UnknownTokenBuilder {
@ -444,7 +430,6 @@ String? textualOutline(
ScannerConfiguration configuration, {
bool throwOnUnexpected = false,
bool performModelling = false,
bool addMarkerForUnknownForTest = false,
bool returnNullOnError = true,
required bool enablePatterns,
TextualOutlineInfoForTesting? infoForTesting,
@ -468,6 +453,7 @@ String? textualOutline(
parsedChunks.add(new _LanguageVersionChunk(
languageVersionToken.major, languageVersionToken.minor)
..originalPosition = originalPosition.value++);
infoForTesting?.languageVersionTokens.add(languageVersionToken);
});
Token firstToken = scanner.tokenize();
TextualOutlineListener listener = new TextualOutlineListener();
@ -488,10 +474,10 @@ String? textualOutline(
if (nextToken.isEof) break;
nextToken = _textualizeTokens(listener, nextToken, currentUnknown,
parsedChunks, originalPosition, addMarkerForUnknownForTest);
parsedChunks, originalPosition, infoForTesting);
}
outputUnknownChunk(currentUnknown, parsedChunks, originalPosition,
addMarkerForUnknownForTest);
outputUnknownChunk(
currentUnknown, parsedChunks, originalPosition, infoForTesting);
if (nextToken == null) return null;
@ -564,21 +550,21 @@ Token? _textualizeTokens(
_UnknownTokenBuilder currentUnknown,
List<_Chunk> parsedChunks,
BoxedInt originalPosition,
bool addMarkerForUnknownForTest) {
TextualOutlineInfoForTesting? infoForTesting) {
_ClassChunk? classChunk = listener.classStartToChunk[token];
if (classChunk != null) {
outputUnknownChunk(currentUnknown, parsedChunks, originalPosition,
addMarkerForUnknownForTest);
outputUnknownChunk(
currentUnknown, parsedChunks, originalPosition, infoForTesting);
parsedChunks.add(classChunk..originalPosition = originalPosition.value++);
return _textualizeClass(
listener, classChunk, originalPosition, addMarkerForUnknownForTest);
listener, classChunk, originalPosition, infoForTesting);
}
_SingleImportExportChunk? singleImportExport =
listener.importExportsStartToChunk[token];
if (singleImportExport != null) {
outputUnknownChunk(currentUnknown, parsedChunks, originalPosition,
addMarkerForUnknownForTest);
outputUnknownChunk(
currentUnknown, parsedChunks, originalPosition, infoForTesting);
parsedChunks
.add(singleImportExport..originalPosition = originalPosition.value++);
return singleImportExport.endToken.next;
@ -587,8 +573,8 @@ Token? _textualizeTokens(
_TokenChunk? knownUnsortableChunk =
listener.unsortableElementStartToChunk[token];
if (knownUnsortableChunk != null) {
outputUnknownChunk(currentUnknown, parsedChunks, originalPosition,
addMarkerForUnknownForTest);
outputUnknownChunk(
currentUnknown, parsedChunks, originalPosition, infoForTesting);
parsedChunks
.add(knownUnsortableChunk..originalPosition = originalPosition.value++);
return knownUnsortableChunk.endToken.next;
@ -596,16 +582,16 @@ Token? _textualizeTokens(
_TokenChunk? elementChunk = listener.elementStartToChunk[token];
if (elementChunk != null) {
outputUnknownChunk(currentUnknown, parsedChunks, originalPosition,
addMarkerForUnknownForTest);
outputUnknownChunk(
currentUnknown, parsedChunks, originalPosition, infoForTesting);
parsedChunks.add(elementChunk..originalPosition = originalPosition.value++);
return elementChunk.endToken.next;
}
_MetadataChunk? metadataChunk = listener.metadataStartToChunk[token];
if (metadataChunk != null) {
outputUnknownChunk(currentUnknown, parsedChunks, originalPosition,
addMarkerForUnknownForTest);
outputUnknownChunk(
currentUnknown, parsedChunks, originalPosition, infoForTesting);
parsedChunks
.add(metadataChunk..originalPosition = originalPosition.value++);
return metadataChunk.endToken.next;
@ -625,7 +611,7 @@ Token? _textualizeTokens(
}
Token _textualizeClass(TextualOutlineListener listener, _ClassChunk classChunk,
BoxedInt originalPosition, bool addMarkerForUnknownForTest) {
BoxedInt originalPosition, TextualOutlineInfoForTesting? infoForTesting) {
Token? token = classChunk.startToken;
// Class header.
while (token != classChunk.endToken) {
@ -648,10 +634,10 @@ Token _textualizeClass(TextualOutlineListener listener, _ClassChunk classChunk,
_UnknownTokenBuilder currentUnknown = new _UnknownTokenBuilder();
while (token != classChunk.endToken) {
token = _textualizeTokens(listener, token!, currentUnknown,
classChunk.content, originalPosition, addMarkerForUnknownForTest);
classChunk.content, originalPosition, infoForTesting);
}
outputUnknownChunk(currentUnknown, classChunk.content, originalPosition,
addMarkerForUnknownForTest);
outputUnknownChunk(
currentUnknown, classChunk.content, originalPosition, infoForTesting);
classChunk.footerStart = classChunk.endToken;
}
@ -665,11 +651,12 @@ void outputUnknownChunk(
_UnknownTokenBuilder _currentUnknown,
List<_Chunk> parsedChunks,
BoxedInt originalPosition,
bool addMarkerForUnknownForTest) {
TextualOutlineInfoForTesting? infoForTesting) {
if (_currentUnknown.start == null) return;
parsedChunks.add(new _UnknownChunk(addMarkerForUnknownForTest,
_currentUnknown.start!, _currentUnknown.interimEnd!)
..originalPosition = originalPosition.value++);
infoForTesting?.hasUnknownChunk = true;
parsedChunks.add(
new _UnknownChunk(_currentUnknown.start!, _currentUnknown.interimEnd!)
..originalPosition = originalPosition.value++);
_currentUnknown.start = null;
_currentUnknown.interimEnd = null;
}
@ -927,4 +914,6 @@ class TextualOutlineListener extends Listener {
class TextualOutlineInfoForTesting {
bool hasParserErrors = false;
bool hasUnknownChunk = false;
List<LanguageVersionToken> languageVersionTokens = [];
}

View file

@ -8,6 +8,7 @@ import 'dart:io';
import 'package:_fe_analyzer_shared/src/scanner/abstract_scanner.dart'
show ScannerConfiguration;
import 'package:_fe_analyzer_shared/src/scanner/token.dart';
import 'package:dart_style/dart_style.dart' show DartFormatter;
import 'package:front_end/src/api_prototype/experimental_flags.dart';
import 'package:front_end/src/fasta/util/textual_outline.dart';
@ -26,6 +27,9 @@ import '../utils/kernel_chain.dart' show MatchContext;
import 'testing/folder_options.dart';
import 'testing/suite.dart' show UPDATE_EXPECTATIONS;
const int minSupportedMajorVersion = 2;
const int minSupportedMinorVersion = 12;
const List<Map<String, String>> EXPECTATIONS = [
{
"name": "ExpectationFileMismatch",
@ -117,7 +121,6 @@ class TextualOutline extends Step<TestDescription, TestDescription, Context> {
),
throwOnUnexpected: true,
performModelling: modelled,
addMarkerForUnknownForTest: modelled,
returnNullOnError: false,
enablePatterns: isExperimentEnabled(ExperimentalFlag.patterns,
explicitExperimentalFlags: experimentalFlags),
@ -128,21 +131,19 @@ class TextualOutline extends Step<TestDescription, TestDescription, Context> {
null, context.expectationSet["EmptyOutput"], description.uri);
}
List<String> lines = result.split("\n");
bool containsUnknownChunk = false;
StringBuffer sb = new StringBuffer();
for (String line in lines) {
if (line == "---- unknown chunk starts ----") {
containsUnknownChunk = true;
bool containsUnknownChunk = info.hasUnknownChunk;
bool tryFormat = !containsUnknownChunk;
for (LanguageVersionToken version in info.languageVersionTokens) {
if (version.major < minSupportedMajorVersion) {
tryFormat = false;
} else if (version.major == minSupportedMajorVersion &&
version.minor < minSupportedMinorVersion) {
tryFormat = false;
}
sb.writeln(line);
}
result = sb.toString().trim();
dynamic formatterException;
StackTrace? formatterExceptionSt;
if (!containsUnknownChunk) {
// Try to format only if it doesn't contain the unknown chunk marker.
if (tryFormat) {
try {
List<String> experimentFlags = [];
for (MapEntry<ExperimentalFlag, bool> entry

View file

@ -8,18 +8,27 @@ import 'package:_fe_analyzer_shared/src/scanner/abstract_scanner.dart'
show ScannerConfiguration;
import "package:front_end/src/fasta/util/textual_outline.dart"
show textualOutline;
show TextualOutlineInfoForTesting, textualOutline;
const ScannerConfiguration scannerConfiguration =
const ScannerConfiguration(enableExtensionMethods: true);
void main() {
TextualOutlineInfoForTesting infoForTesting;
// Doesn't sort if not asked to perform modelling.
String? result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
String? result = textualOutline(
utf8.encode("""
b() { print("hello"); }
a() { print("hello"); }
"""), scannerConfiguration,
throwOnUnexpected: true, performModelling: false, enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: false,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
b() {}
@ -27,16 +36,21 @@ b() {}
a() {}""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Sort if asked to perform modelling.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
b() { print("hello"); }
a() { print("hello"); }
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
a() {}
@ -44,47 +58,62 @@ a() {}
b() {}""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Content between braces or not doesn't make any difference.
// Procedure without content.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
a() {}
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
a() {}""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Procedure with content.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
a() {
// Whatever
}
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
a() {}""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Class without content.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
class B {}
class A {}
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
class A {}
@ -92,25 +121,33 @@ class A {}
class B {}""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Class without real content.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
class A {
// Whatever
}
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
class A {}""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Has space between entries.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
@a
@A(2)
typedef void F1();
@ -118,11 +155,13 @@ typedef void F1();
@a
@A(3)
int f1, f2;
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
@a
@ -134,20 +173,25 @@ int f1, f2;
typedef void F1();""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Has space between entries.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
@a
@A(2)
typedef void F1();
@a
@A(3)
int f1, f2;
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
@a
@ -159,17 +203,22 @@ int f1, f2;
typedef void F1();""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Knows about and can sort named mixin applications.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
class C<T> = Object with A<Function(T)>;
class B<T> = Object with A<Function(T)>;
class A<T> {}
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
class A<T> {}
@ -179,10 +228,13 @@ class B<T> = Object with A<Function(T)>;
class C<T> = Object with A<Function(T)>;""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Knows about and can sort imports, but doesn't mix them with the other
// content.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
import "foo.dart" show B,
A,
C;
@ -191,12 +243,14 @@ import "bar.dart";
main() {}
import "baz.dart";
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
returnNullOnError: false,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
returnNullOnError: false,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
import "bar.dart";
@ -207,10 +261,13 @@ main() {}
import "baz.dart";""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Knows about and can sort exports, but doesn't mix them with the other
// content.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
export "foo.dart" show B,
A,
C;
@ -219,12 +276,14 @@ export "bar.dart";
main() {}
export "baz.dart";
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
returnNullOnError: false,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
returnNullOnError: false,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
export "bar.dart";
@ -235,10 +294,13 @@ main() {}
export "baz.dart";""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Knows about and can sort imports and exports,
// but doesn't mix them with the other content.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
export "foo.dart" show B,
A,
C;
@ -252,12 +314,14 @@ main() {}
export "baz.dart";
import "baz.dart";
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
returnNullOnError: false,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
returnNullOnError: false,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
export "bar.dart";
@ -271,9 +335,12 @@ export "baz.dart";
import "baz.dart";""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Knows about library, part and part of but they cannot be sorted.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
part "foo.dart";
part of "foo.dart";
library foo;
@ -281,12 +348,14 @@ library foo;
bar() {
// whatever
}
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
returnNullOnError: false,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
returnNullOnError: false,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
part "foo.dart";
@ -298,21 +367,26 @@ library foo;
bar() {}""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Ending metadata (not associated with anything) is still present.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
@Object2()
foo() {
// hello
}
@Object1()
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
returnNullOnError: false,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
returnNullOnError: false,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
@Object2()
@ -321,20 +395,25 @@ foo() {}
@Object1()""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Sorting of question mark types.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
class Class1 {
Class1? get nullable1 => property1;
Class2? get property => null;
Class1 get nonNullable1 => property1;
Class2 get property1 => new Class1();
}
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
class Class1 {
@ -345,18 +424,23 @@ class Class1 {
}""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Sorting of various classes with numbers and less than.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
class C2<V> = Super<V> with Mixin<V>;
class C<V> extends Super<V> with Mixin<V> {}
class D extends Super with Mixin {}
class D2 = Super with Mixin;
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
class C<V> extends Super<V> with Mixin<V> {}
@ -368,9 +452,12 @@ class D extends Super with Mixin {}
class D2 = Super with Mixin;""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Metadata on imports / exports.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
@Object1
export "a3.dart";
@Object2
@ -379,11 +466,13 @@ import "a2.dart";
export "a1.dart";
@Object4
import "a0.dart";
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
@Object3
@ -399,12 +488,15 @@ import "a0.dart";
import "a2.dart";""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
// Doesn't crash on illegal import/export.
// Note that for now a bad import becomes unknown as it has
// 'advanced recovery' via "handleRecoverImport" whereas exports enforce the
// structure more.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
// bad line.
import "a0.dart" show
// ok line
@ -413,26 +505,29 @@ import "a1.dart" show foo;
export "a2.dart" show
// ok line
export "a3.dart" show foo;
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
returnNullOnError: false,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
returnNullOnError: false,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
---- unknown chunk starts ----
import "a0.dart" show ;
---- unknown chunk ends ----
export "a2.dart" show ;
export "a3.dart" show foo;
import "a1.dart" show foo;""") {
throw "Unexpected result: $result";
}
expectUnknownChunk(infoForTesting);
// Enums.
result = textualOutline(utf8.encode("""
infoForTesting = new TextualOutlineInfoForTesting();
result = textualOutline(
utf8.encode("""
library test;
enum E { v1 }
@ -441,11 +536,13 @@ final x = E.v1;
main() {
x;
}
"""), scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
addMarkerForUnknownForTest: true,
enablePatterns: true);
"""),
scannerConfiguration,
throwOnUnexpected: true,
performModelling: true,
enablePatterns: true,
infoForTesting: infoForTesting,
);
if (result !=
"""
library test;
@ -457,4 +554,17 @@ final x = E.v1;
main() {}""") {
throw "Unexpected result: $result";
}
expectNoUnknownChunk(infoForTesting);
}
void expectUnknownChunk(TextualOutlineInfoForTesting infoForTesting) {
if (infoForTesting.hasUnknownChunk != true) {
throw "Expected output to contain unknown chunk, but didn't.";
}
}
void expectNoUnknownChunk(TextualOutlineInfoForTesting infoForTesting) {
if (infoForTesting.hasUnknownChunk != false) {
throw "Expected output to contain no unknown chunk, but it did.";
}
}

View file

@ -52,6 +52,7 @@ class Class {
}
@Native('d')
class NativeClass {
NativeClass.generative();
factory NativeClass.fact() => null;

View file

@ -1,3 +0,0 @@
extension type ET(int i) {
const ET.named(this.i) {}
}

View file

@ -1,23 +0,0 @@
import 'field_access_lib.dart';
extension on dynamic {
void set it(value) {}
}
extension type DynamicInlineClass(dynamic it) {
void test() {}
}
extension type ErroneousInlineClass(int a, String b) {
void test() {}
}
extension type FunctionInlineClass<T>(T Function() it) {
void test(T Function() t) {}
}
extension type GenericFunctionInlineClass(T Function<T>() it) {
void test() {}
}
extension type GenericInlineClass<T>(T it) {
void test(T t) {}
}
extension type InlineClass(int it) {
void test() {}
}
void test( InlineClass inlineClass, GenericInlineClass<String> genericInlineClass, FunctionInlineClass<String> functionInlineClass, GenericFunctionInlineClass genericFunctionInlineClass, DynamicInlineClass dynamicInlineClass, ErroneousInlineClass erroneousInlineClass, PrivateInlineClass privateInlineClass) {}

View file

@ -1,12 +0,0 @@
expect(expected, actual) {}
extension type Bar<T>._(this.i) {
Bar(T i) : this._(i);
}
extension type Foo._(int i) {
Foo(int i) : this._(i + 2);
Foo.erroneous() : this.unresolved();
Foo.named(int value, {required int subtract}) : i = value - subtract;
Foo.redirectNamed1(int a, int b) : this.named(a, subtract: b);
Foo.redirectNamed2(int a, int b) : this.named(subtract: b, a);
}
main() {}

View file

@ -1,10 +0,0 @@
extension type E1(int foo) {
E1.named(this.foo, super.bar);
}
extension type E2(int foo) {
E2.named(this.foo, {required super.bar});
}
extension type E3(int foo) {
E3.named(this.foo, [super.bar = null]);
}
extension type E4(super.foo) {}

View file

@ -1,3 +0,0 @@
extension type Duplicate(bool instanceField, int instanceField) {}
extension type Missing() {}
extension type Multiple(bool instanceField1, int instanceField2) {}

View file

@ -1,13 +0,0 @@
import './main_lib.dart';
class A{}
---- unknown chunk starts ----
(
---- unknown chunk ends ----
String foo;
---- unknown chunk starts ----
) { factory A.redirectingFactoryToSubtype() = E.redirectingFactoryWithMismatchingParameters; }
---- unknown chunk ends ----

View file

@ -1,5 +0,0 @@
---- unknown chunk starts ----
import "syntax_lib.dart" as 28;
---- unknown chunk ends ----
digits;

View file

@ -1,5 +0,0 @@
// @dart = 2.19
abstract base class B {}
base class A {}
base class C = Object with M;
base mixin M {}

View file

@ -2,21 +2,12 @@
class Foo {
final int x;
const Foo(this.x)
: assert(x > 0, "x is not positive"),
assert(x > 0),
assert(x > 0, ""),
assert(const bool.fromEnvironment("foo") == false,
"foo was ${const bool.fromEnvironment("foo")}"),
assert(const bool.fromEnvironment("foo") == false);
const Foo.withMessage(this.x)
: assert(x < 0, "btw foo was ${const bool.fromEnvironment("foo")}");
const Foo(this.x) : assert(x > 0, "x is not positive"), assert(x > 0), assert(x > 0, ""), assert(const bool.fromEnvironment("foo") == false, "foo was ${const bool.fromEnvironment("foo")}"), assert(const bool.fromEnvironment("foo") == false);
const Foo.withMessage(this.x) : assert(x < 0, "btw foo was ${const bool.fromEnvironment("foo")}");
const Foo.withInvalidMessage(this.x) : assert(x < 0, x);
const Foo.withInvalidCondition(this.x) : assert(x);
const Foo.withNullConditionFromEnv1(this.x)
: assert(bool.fromEnvironment("foo", defaultValue: null));
const Foo.withNullConditionFromEnv2(this.x)
: assert(const bool.fromEnvironment("foo", defaultValue: null));
const Foo.withNullConditionFromEnv1(this.x) : assert(bool.fromEnvironment("foo", defaultValue: null));
const Foo.withNullConditionFromEnv2(this.x) : assert(const bool.fromEnvironment("foo", defaultValue: null));
}
class Bar {

View file

@ -8,21 +8,12 @@ class Bar {
}
class Foo {
const Foo(this.x)
: assert(x > 0, "x is not positive"),
assert(x > 0),
assert(x > 0, ""),
assert(const bool.fromEnvironment("foo") == false,
"foo was ${const bool.fromEnvironment("foo")}"),
assert(const bool.fromEnvironment("foo") == false);
const Foo(this.x) : assert(x > 0, "x is not positive"), assert(x > 0), assert(x > 0, ""), assert(const bool.fromEnvironment("foo") == false, "foo was ${const bool.fromEnvironment("foo")}"), assert(const bool.fromEnvironment("foo") == false);
const Foo.withInvalidCondition(this.x) : assert(x);
const Foo.withInvalidMessage(this.x) : assert(x < 0, x);
const Foo.withMessage(this.x)
: assert(x < 0, "btw foo was ${const bool.fromEnvironment("foo")}");
const Foo.withNullConditionFromEnv1(this.x)
: assert(bool.fromEnvironment("foo", defaultValue: null));
const Foo.withNullConditionFromEnv2(this.x)
: assert(const bool.fromEnvironment("foo", defaultValue: null));
const Foo.withMessage(this.x) : assert(x < 0, "btw foo was ${const bool.fromEnvironment("foo")}");
const Foo.withNullConditionFromEnv1(this.x) : assert(bool.fromEnvironment("foo", defaultValue: null));
const Foo.withNullConditionFromEnv2(this.x) : assert(const bool.fromEnvironment("foo", defaultValue: null));
final int x;
}

View file

@ -1,7 +0,0 @@
class Class {
Class();
const Class.named() {}
}
const a = const Class();
const b = const Class.named();
main() {}

View file

@ -16,16 +16,7 @@ class Class<T> {
final field10;
final field11;
final field15;
const Class(o)
: field1 = T,
field5 = <T>[],
field6 = <T>{},
field7 = <T, T>{},
field8 = o is T,
field9 = o is Class<T>,
field10 = o as T,
field11 = o as Class<T>,
field15 = <Class<T>>[];
const Class(o) : field1 = T, field5 = <T>[], field6 = <T>{}, field7 = <T, T>{}, field8 = o is T, field9 = o is Class<T>, field10 = o as T, field11 = o as Class<T>, field15 = <Class<T>>[];
void method() {}
}

View file

@ -6,16 +6,7 @@ import 'potentially_constant_type_lib2.dart';
T id<T>(T t) => t;
class Class<T> {
const Class(o)
: field1 = T,
field5 = <T>[],
field6 = <T>{},
field7 = <T, T>{},
field8 = o is T,
field9 = o is Class<T>,
field10 = o as T,
field11 = o as Class<T>,
field15 = <Class<T>>[];
const Class(o) : field1 = T, field5 = <T>[], field6 = <T>{}, field7 = <T, T>{}, field8 = o is T, field9 = o is Class<T>, field10 = o as T, field11 = o as Class<T>, field15 = <Class<T>>[];
final field1;
final field10;
final field11;

View file

@ -1,144 +1,259 @@
// @dart = 2.9
AbstractClassWithConstructor abstractClassWithConstructor = const AbstractClassWithConstructor();
ClassWithNonEmptyConstConstructor classWithNonEmptyConstConstructor = const ClassWithNonEmptyConstConstructor();
ConstClassWithFailingAssertWithEmptyMessage failedAssertEmptyMessage = const ConstClassWithFailingAssertWithEmptyMessage();
ConstClassWithFinalFields2 constClassWithFinalFields = const ConstClassWithFinalFields2();
T id1<T>(T t) => t;
T id2<T>(T t) => t;
abstract class AbstractClass {}
abstract class AbstractClassWithConstructor {
const AbstractClassWithConstructor();
int foo();
}
class ClassWithNonEmptyConstConstructor {
const ClassWithNonEmptyConstConstructor() {}
}
class ClassWithTypeArguments<E, F, G> {
const ClassWithTypeArguments(E e, F f, G g);
}
class ConstClassWithFailingAssertWithEmptyMessage {
const ConstClassWithFailingAssertWithEmptyMessage() : assert(false, "");
}
class ConstClassWithFinalFields1 {
const ConstClassWithFinalFields1();
final x = 1;
}
class ConstClassWithFinalFields2 {
const ConstClassWithFinalFields2();
final y = 1;
final z1 = y;
final z2 = x;
}
class ExtendsFoo1 extends Foo {}
class ExtendsFoo2 extends Foo {
const ExtendsFoo2();
}
class Foo {
const Foo(int x) : this.x = x, this.y = "hello".length;
final int x;
final int y;
}
class NotAbstractClass {
@AbstractClassWithConstructor()
Object bar;
@AbstractClass()
Object foo;
}
const ClassWithTypeArguments classWithTypeArguments1 = const ClassWithTypeArguments<int, int, int>(42, 42, 42);
const ClassWithTypeArguments classWithTypeArguments2 = const ClassWithTypeArguments(42, 42, 42);
const ExtendsFoo1 extendsFoo1 = const ExtendsFoo1();
const ExtendsFoo2 extendsFoo2 = const ExtendsFoo2();
const Foo foo1 = const Foo(42);
const Foo foo2 = const Foo(42);
const String barFromEnvOrActualString = const String.fromEnvironment("bar", defaultValue: "hello");
const String barFromEnvOrNullString = const String.fromEnvironment("bar", defaultValue: null);
const String barFromEnvString = const String.fromEnvironment("bar");
const String bazFromEnvAsString = const String.fromEnvironment("baz");
const String nullFromEnvString = const String.fromEnvironment(barFromEnvOrNullString);
const Symbol barFoo = const Symbol("Foo");
const Symbol barFooEqual = const Symbol("Foo=");
const Symbol symbolWithDots = const Symbol("I.Have.Dots");
const Symbol tripleShiftSymbol = const Symbol(">>>");
const binaryOnDouble = willBeDouble << 2;
const binaryOnIntWithDoubleBad = willBeInt << willBeDouble;
const binaryOnIntWithDoubleOK = willBeInt + willBeDouble;
const binaryOnIntWithString = willBeInt << "hello";
const binaryOnStringWithInt = willBeString + willBeInt;
const binaryOnStringWithStringBad = willBeString - " world";
const binaryOnStringWithStringOK = willBeString + " world";
const bool andOnFalse = nullAwareOnNullFalse && nullAwareOnNullTrue;
const bool andOnFalse2 = nullAwareOnNullTrue && nullAwareOnNullFalse;
const bool andOnNull = barFromEnvOrNull && true;
const bool andOnNull2 = true && barFromEnvOrNull;
const bool barFromEnv = const bool.fromEnvironment("bar");
const bool barFromEnvBool = const bool.fromEnvironment("bar");
const bool barFromEnvOrActualBool = const bool.fromEnvironment("bar", defaultValue: true);
const bool barFromEnvOrNull = const bool.fromEnvironment("bar", defaultValue: null);
const bool barFromEnvOrNullBool = const bool.fromEnvironment("bar", defaultValue: null);
const bool bazFalseFromEnv = const bool.fromEnvironment("bazFalse");
const bool bazFromEnv = const bool.fromEnvironment("baz");
const bool bazTrueFromEnv = const bool.fromEnvironment("bazTrue");
const bool binaryOnBoolAmpersand = trueBool & falseBool;
const bool binaryOnBoolBar = trueBool | falseBool;
const bool binaryOnBoolBar2 = falseBool | trueBool;
const bool binaryOnBoolCaret = trueBool ^ falseBool;
const bool classWithTypeArgumentsIdentical = identical(classWithTypeArguments1, classWithTypeArguments2);
const bool conditionalOnNull = barFromEnvOrNull ? true : false;
const bool falseBool = false;
const bool foosEqual = foo1 == foo2;
const bool foosIdentical = identical(foo1, foo2);
const bool hasBarEnv = const bool.hasEnvironment("bar");
const bool hasBazEnv = const bool.hasEnvironment("baz");
const bool isItInt = maybeInt is int ? true : false;
const bool isItInt2 = maybeInt2 is int ? true : false;
const bool isItInt3 = maybeInt3 is int ? true : false;
const bool notBarFromEnvOrNull = !barFromEnvOrNull;
const bool nullAwareOnNullFalse = barFromEnvOrNull ?? false;
const bool nullAwareOnNullTrue = barFromEnvOrNull ?? true;
const bool nullFromEnvBool = const bool.fromEnvironment(barFromEnvOrNullString);
const bool orOnNull = barFromEnvOrNull || true;
const bool orOnNull2 = barFromEnvOrNull || false;
const bool orOnNull3 = true || barFromEnvOrNull;
const bool orOnNull4 = false || barFromEnvOrNull;
const bool trueBool = true;
const bool yBool = true;
const bool zBool = !yBool;
const dynamic willBeDouble = const bool.fromEnvironment("foo") ? 42 : 42.42;
const dynamic willBeInt = const bool.fromEnvironment("foo") ? 42.42 : 42;
const dynamic willBeString = const bool.fromEnvironment("foo") ? 42.42 : "hello";
const dynamic willBecomeNull = const bool.fromEnvironment("foo") ? id1 : null;
const function_const = () {};
const int Function(int) partialInstantiation = const bool.fromEnvironment("foo") ? willBecomeNull : id1;
const int Function(int) willBecomeNullToo = const bool.fromEnvironment("foo") ? id1 : willBecomeNull;
const int barFromEnvInt = const int.fromEnvironment("bar");
const int barFromEnvOrActualInt = const int.fromEnvironment("bar", defaultValue: 42);
const int barFromEnvOrNullInt = const int.fromEnvironment("bar", defaultValue: null);
const int bazFromEnvAsInt = const int.fromEnvironment("baz");
const int circularity1 = circularity2;
const int circularity2 = circularity3;
const int circularity3 = circularity4;
const int circularity4 = circularity1;
const int nullFromEnvInt = const int.fromEnvironment(barFromEnvOrNullString);
const maybeInt = bool.fromEnvironment("foo") ? 42 : true;
const maybeInt2 = zBool ? 42 : true;
const maybeInt3 = zBool ? 42 : null;
const nanEqual = 0 / 0 == 0 / 0;
const nanIdentical = identical(0 / 0, 0 / 0);
const x1 = --x;
const x2 = ++x;
const x3 = x--;
const x4 = x++;
const y = 1;
const y1 = --y;
const y2 = ++y;
const y3 = y--;
const y4 = y++;
const zeroEqualToZeroPointZero = 0 == 0.0;
const zeroIdenticalToZeroPointZero = identical(0, 0.0);
const zeroPointZeroEqual = 0.0 == 0.0;
const zeroPointZeroEqualToZero = 0.0 == 0;
const zeroPointZeroIdentical = identical(0.0, 0.0);
const zeroPointZeroIdenticalToZero = identical(0.0, 0);
main() {}
var function_var = () {};
var x = 1;

View file

@ -1,143 +0,0 @@
AbstractClassWithConstructor abstractClassWithConstructor = const AbstractClassWithConstructor();
ClassWithNonEmptyConstConstructor classWithNonEmptyConstConstructor = const ClassWithNonEmptyConstConstructor();
ConstClassWithFailingAssertWithEmptyMessage failedAssertEmptyMessage = const ConstClassWithFailingAssertWithEmptyMessage();
ConstClassWithFinalFields2 constClassWithFinalFields = const ConstClassWithFinalFields2();
T id1<T>(T t) => t;
T id2<T>(T t) => t;
abstract class AbstractClass {}
abstract class AbstractClassWithConstructor {
const AbstractClassWithConstructor();
int foo();
}
class ClassWithNonEmptyConstConstructor {
const ClassWithNonEmptyConstConstructor() {}
}
class ClassWithTypeArguments<E, F, G> {
const ClassWithTypeArguments(E e, F f, G g);
}
class ConstClassWithFailingAssertWithEmptyMessage {
const ConstClassWithFailingAssertWithEmptyMessage() : assert(false, "");
}
class ConstClassWithFinalFields1 {
const ConstClassWithFinalFields1();
final x = 1;
}
class ConstClassWithFinalFields2 {
const ConstClassWithFinalFields2();
final y = 1;
final z1 = y;
final z2 = x;
}
class ExtendsFoo1 extends Foo {}
class ExtendsFoo2 extends Foo {
const ExtendsFoo2();
}
class Foo {
const Foo(int x) : this.x = x, this.y = "hello".length;
final int x;
final int y;
}
class NotAbstractClass {
@AbstractClassWithConstructor()
Object bar;
@AbstractClass()
Object foo;
}
const ClassWithTypeArguments classWithTypeArguments1 = const ClassWithTypeArguments<int, int, int>(42, 42, 42);
const ClassWithTypeArguments classWithTypeArguments2 = const ClassWithTypeArguments(42, 42, 42);
const ExtendsFoo1 extendsFoo1 = const ExtendsFoo1();
const ExtendsFoo2 extendsFoo2 = const ExtendsFoo2();
const Foo foo1 = const Foo(42);
const Foo foo2 = const Foo(42);
const String barFromEnvOrActualString = const String.fromEnvironment("bar", defaultValue: "hello");
const String barFromEnvOrNullString = const String.fromEnvironment("bar", defaultValue: null);
const String barFromEnvString = const String.fromEnvironment("bar");
const String bazFromEnvAsString = const String.fromEnvironment("baz");
const String nullFromEnvString = const String.fromEnvironment(barFromEnvOrNullString);
const Symbol barFoo = const Symbol("Foo");
const Symbol barFooEqual = const Symbol("Foo=");
const Symbol symbolWithDots = const Symbol("I.Have.Dots");
const Symbol tripleShiftSymbol = const Symbol(">>>");
const binaryOnDouble = willBeDouble << 2;
const binaryOnIntWithDoubleBad = willBeInt << willBeDouble;
const binaryOnIntWithDoubleOK = willBeInt + willBeDouble;
const binaryOnIntWithString = willBeInt << "hello";
const binaryOnStringWithInt = willBeString + willBeInt;
const binaryOnStringWithStringBad = willBeString - " world";
const binaryOnStringWithStringOK = willBeString + " world";
const bool andOnFalse = nullAwareOnNullFalse && nullAwareOnNullTrue;
const bool andOnFalse2 = nullAwareOnNullTrue && nullAwareOnNullFalse;
const bool andOnNull = barFromEnvOrNull && true;
const bool andOnNull2 = true && barFromEnvOrNull;
const bool barFromEnv = const bool.fromEnvironment("bar");
const bool barFromEnvBool = const bool.fromEnvironment("bar");
const bool barFromEnvOrActualBool = const bool.fromEnvironment("bar", defaultValue: true);
const bool barFromEnvOrNull = const bool.fromEnvironment("bar", defaultValue: null);
const bool barFromEnvOrNullBool = const bool.fromEnvironment("bar", defaultValue: null);
const bool bazFalseFromEnv = const bool.fromEnvironment("bazFalse");
const bool bazFromEnv = const bool.fromEnvironment("baz");
const bool bazTrueFromEnv = const bool.fromEnvironment("bazTrue");
const bool binaryOnBoolAmpersand = trueBool & falseBool;
const bool binaryOnBoolBar = trueBool | falseBool;
const bool binaryOnBoolBar2 = falseBool | trueBool;
const bool binaryOnBoolCaret = trueBool ^ falseBool;
const bool classWithTypeArgumentsIdentical = identical(classWithTypeArguments1, classWithTypeArguments2);
const bool conditionalOnNull = barFromEnvOrNull ? true : false;
const bool falseBool = false;
const bool foosEqual = foo1 == foo2;
const bool foosIdentical = identical(foo1, foo2);
const bool hasBarEnv = const bool.hasEnvironment("bar");
const bool hasBazEnv = const bool.hasEnvironment("baz");
const bool isItInt = maybeInt is int ? true : false;
const bool isItInt2 = maybeInt2 is int ? true : false;
const bool isItInt3 = maybeInt3 is int ? true : false;
const bool notBarFromEnvOrNull = !barFromEnvOrNull;
const bool nullAwareOnNullFalse = barFromEnvOrNull ?? false;
const bool nullAwareOnNullTrue = barFromEnvOrNull ?? true;
const bool nullFromEnvBool = const bool.fromEnvironment(barFromEnvOrNullString);
const bool orOnNull = barFromEnvOrNull || true;
const bool orOnNull2 = barFromEnvOrNull || false;
const bool orOnNull3 = true || barFromEnvOrNull;
const bool orOnNull4 = false || barFromEnvOrNull;
const bool trueBool = true;
const bool yBool = true;
const bool zBool = !yBool;
const dynamic willBeDouble = const bool.fromEnvironment("foo") ? 42 : 42.42;
const dynamic willBeInt = const bool.fromEnvironment("foo") ? 42.42 : 42;
const dynamic willBeString = const bool.fromEnvironment("foo") ? 42.42 : "hello";
const dynamic willBecomeNull = const bool.fromEnvironment("foo") ? id1 : null;
const function_const = () {};
const int Function(int) partialInstantiation = const bool.fromEnvironment("foo") ? willBecomeNull : id1;
const int Function(int) willBecomeNullToo = const bool.fromEnvironment("foo") ? id1 : willBecomeNull;
const int barFromEnvInt = const int.fromEnvironment("bar");
const int barFromEnvOrActualInt = const int.fromEnvironment("bar", defaultValue: 42);
const int barFromEnvOrNullInt = const int.fromEnvironment("bar", defaultValue: null);
const int bazFromEnvAsInt = const int.fromEnvironment("baz");
const int circularity1 = circularity2;
const int circularity2 = circularity3;
const int circularity3 = circularity4;
const int circularity4 = circularity1;
const int nullFromEnvInt = const int.fromEnvironment(barFromEnvOrNullString);
const maybeInt = bool.fromEnvironment("foo") ? 42 : true;
const maybeInt2 = zBool ? 42 : true;
const maybeInt3 = zBool ? 42 : null;
const nanEqual = 0 / 0 == 0 / 0;
const nanIdentical = identical(0 / 0, 0 / 0);
const x1 = --x;
const x2 = ++x;
const x3 = x--;
const x4 = x++;
const y = 1;
const y1 = --y;
const y2 = ++y;
const y3 = y--;
const y4 = y++;
const zeroEqualToZeroPointZero = 0 == 0.0;
const zeroIdenticalToZeroPointZero = identical(0, 0.0);
const zeroPointZeroEqual = 0.0 == 0.0;
const zeroPointZeroEqualToZero = 0.0 == 0;
const zeroPointZeroIdentical = identical(0.0, 0.0);
const zeroPointZeroIdenticalToZero = identical(0.0, 0);
main() {}
var function_var = () {};
var x = 1;

View file

@ -2,18 +2,11 @@
oracle<T>([T t]) => true;
testIfElement(dynamic dynVar, List<int> listInt, List<double> listDouble,
Map<String, int> mapToInt, Map<String, double> mapToDouble) {}
testIfElement(dynamic dynVar, List<int> listInt, List<double> listDouble, Map<String, int> mapToInt, Map<String, double> mapToDouble) {}
testIfElementErrors(Map<int, int> map) {}
testForElement(
dynamic dynVar,
List<int> listInt,
List<double> listDouble,
int index,
Map<String, int> mapStringInt,
Map<String, double> mapStringDouble) {}
testForElement(dynamic dynVar, List<int> listInt, List<double> listDouble, int index, Map<String, int> mapStringInt, Map<String, double> mapStringDouble) {}
testForElementErrors(Map<int, int> map, List<int> list) async {}

View file

@ -10,20 +10,13 @@ main() {}
oracle<T>([T t]) => true;
testForElement(
dynamic dynVar,
List<int> listInt,
List<double> listDouble,
int index,
Map<String, int> mapStringInt,
Map<String, double> mapStringDouble) {}
testForElement(dynamic dynVar, List<int> listInt, List<double> listDouble, int index, Map<String, int> mapStringInt, Map<String, double> mapStringDouble) {}
testForElementErrors(Map<int, int> map, List<int> list) async {}
testForElementErrorsNotAsync(Stream<int> stream) {}
testIfElement(dynamic dynVar, List<int> listInt, List<double> listDouble,
Map<String, int> mapToInt, Map<String, double> mapToDouble) {}
testIfElement(dynamic dynVar, List<int> listInt, List<double> listDouble, Map<String, int> mapToInt, Map<String, double> mapToDouble) {}
testIfElementErrors(Map<int, int> map) {}

View file

@ -1,4 +0,0 @@
// @dart = 2.16
enum A { a; A() : super(); }
enum B { b; const B() : super(); }
main() {}

View file

@ -1,16 +0,0 @@
class Foo {
Foo(){}
Foo() {}
operator/ (): super() {}
---- unknown chunk starts ----
.
---- unknown chunk ends ----
foo(){}
foo() {}
operator/ (): super() {}
operator/ (): super() {}
---- unknown chunk starts ----
.
---- unknown chunk ends ----
operator/ (): super() {}
}

View file

@ -1,3 +0,0 @@
---- unknown chunk starts ----
{<[]()>}
---- unknown chunk ends ----

View file

@ -1,7 +0,0 @@
---- unknown chunk starts ----
()
---- unknown chunk ends ----
async ()=> a
b < c $? >;

View file

@ -1,3 +0,0 @@
// @dart = 2.18
extension type ExtensionType1(int it) {}
extension type ExtensionType2<T>._(int it) implements int, ExtensionType1 {}

View file

@ -1,13 +0,0 @@
abstract class A {}
class B {
final A a;
external B(A a);
external B.named(int i);
external A method();
external T genericMethod<T>(T t);
external B get getter;
external void set setter(B b);
}
void method(A a) {}

View file

@ -1,13 +0,0 @@
abstract class A {}
class B {
external A method();
external B(A a);
external B.named(int i);
external B get getter;
external T genericMethod<T>(T t);
external void set setter(B b);
final A a;
}
void method(A a) {}

View file

@ -1,6 +0,0 @@
class Class {
factory var x ()= ;
---- unknown chunk starts ----
1;
---- unknown chunk ends ----
}

View file

@ -10,8 +10,7 @@ class Coordinate extends Struct {
@Double()
double y;
Pointer<Coordinate> next;
factory Coordinate.allocate(
Allocator allocator, double x, double y, Pointer<Coordinate> next) {}
factory Coordinate.allocate( Allocator allocator, double x, double y, Pointer<Coordinate> next) {}
}
main() {}

View file

@ -9,8 +9,7 @@ class Coordinate extends Struct {
double x;
@Double()
double y;
factory Coordinate.allocate(
Allocator allocator, double x, double y, Pointer<Coordinate> next) {}
factory Coordinate.allocate( Allocator allocator, double x, double y, Pointer<Coordinate> next) {}
}
main() {}

View file

@ -1,5 +0,0 @@
// @dart = 2.19
abstract final class B {}
final class A {}
final class C = Object with M;
mixin M {}

View file

@ -30,8 +30,7 @@ typedef G2<X extends num> = void Function<T extends X>();
typedef G3<X, Y> = void Function<T extends X, S extends Y>();
typedef G4<X extends num, Y extends num> = void
Function<T extends X, S extends Y>();
typedef G4<X extends num, Y extends num> = void Function<T extends X, S extends Y>();
typedef G5<X extends num> = void Function<T extends S, S extends X>();

View file

@ -32,8 +32,7 @@ typedef G2<X extends num> = void Function<T extends X>();
typedef G3<X, Y> = void Function<T extends X, S extends Y>();
typedef G4<X extends num, Y extends num> = void
Function<T extends X, S extends Y>();
typedef G4<X extends num, Y extends num> = void Function<T extends X, S extends Y>();
typedef G5<X extends num> = void Function<T extends S, S extends X>();

View file

@ -61,25 +61,7 @@ class C implements A<int>, B<int, String> {
var field16;
var field17;
var field18;
C(
this.field1,
this.field2,
this.field3,
this.field4,
this.field5,
this.field6,
this.field7,
this.field8,
this.field9,
this.field10,
this.field11,
this.field12,
this.field13,
this.field14,
this.field15,
this.field16,
this.field17,
this.field18);
C( this.field1, this.field2, this.field3, this.field4, this.field5, this.field6, this.field7, this.field8, this.field9, this.field10, this.field11, this.field12, this.field13, this.field14, this.field15, this.field16, this.field17, this.field18);
}
class D<T> implements A<T>, B<T, T> {
@ -101,23 +83,5 @@ class D<T> implements A<T>, B<T, T> {
var field16;
var field17;
var field18;
D(
this.field1,
this.field2,
this.field3,
this.field4,
this.field5,
this.field6,
this.field7,
this.field8,
this.field9,
this.field10,
this.field11,
this.field12,
this.field13,
this.field14,
this.field15,
this.field16,
this.field17,
this.field18);
D( this.field1, this.field2, this.field3, this.field4, this.field5, this.field6, this.field7, this.field8, this.field9, this.field10, this.field11, this.field12, this.field13, this.field14, this.field15, this.field16, this.field17, this.field18);
}

View file

@ -43,25 +43,7 @@ class B<T, S> {
}
class C implements A<int>, B<int, String> {
C(
this.field1,
this.field2,
this.field3,
this.field4,
this.field5,
this.field6,
this.field7,
this.field8,
this.field9,
this.field10,
this.field11,
this.field12,
this.field13,
this.field14,
this.field15,
this.field16,
this.field17,
this.field18);
C( this.field1, this.field2, this.field3, this.field4, this.field5, this.field6, this.field7, this.field8, this.field9, this.field10, this.field11, this.field12, this.field13, this.field14, this.field15, this.field16, this.field17, this.field18);
int field12;
int field14;
var field1;
@ -83,25 +65,7 @@ class C implements A<int>, B<int, String> {
}
class D<T> implements A<T>, B<T, T> {
D(
this.field1,
this.field2,
this.field3,
this.field4,
this.field5,
this.field6,
this.field7,
this.field8,
this.field9,
this.field10,
this.field11,
this.field12,
this.field13,
this.field14,
this.field15,
this.field16,
this.field17,
this.field18);
D( this.field1, this.field2, this.field3, this.field4, this.field5, this.field6, this.field7, this.field8, this.field9, this.field10, this.field11, this.field12, this.field13, this.field14, this.field15, this.field16, this.field17, this.field18);
T field12;
T field14;
var field1;

View file

@ -1,5 +0,0 @@
// @dart = 2.19
abstract interface class B {}
interface class A {}
interface class C = Object with M;
mixin M {}

View file

@ -1,147 +0,0 @@
class Operators1 {
operator %() => true;
operator &() => true;
operator *() => true;
operator +() => true;
operator /() => true;
operator <() => true;
operator <<() => true;
operator <=() => true;
operator ==() => true;
operator >() => true;
operator >=() => true;
operator >>() => true;
operator []() => true;
operator []=(a, b, c) => true;
operator ^() => true;
operator |() => true;
operator ~(a) => true;
operator ~/() => true;
}
class Operators2 {
operator %(a, b) => true;
operator &(a, b) => true;
operator *(a, b) => true;
operator +(a, b) => true;
operator -(a, b) => true;
operator /(a, b) => true;
operator <(a, b) => true;
operator <<(a, b) => true;
operator <=(a, b) => true;
operator ==(a, b) => true;
operator >(a, b) => true;
operator >=(a, b) => true;
operator >>(a, b) => true;
operator [](a, b) => true;
operator []=(a, b, c) => true;
operator ^(a, b) => true;
operator |(a, b) => true;
operator ~(a, b) => true;
operator ~/(a, b) => true;
}
class Operators3 {
operator %([a]) => true;
operator &([a]) => true;
operator *([a]) => true;
operator +([a]) => true;
operator -([a]) => true;
operator /([a]) => true;
operator <([a]) => true;
operator <<([a]) => true;
operator <=([a]) => true;
operator ==([a = 0]) => true;
operator >([a]) => true;
operator >=([a]) => true;
operator >>([a]) => true;
operator []([a]) => true;
operator []=([a, b]) => true;
operator ^([a]) => true;
operator |([a]) => true;
operator ~([a]) => true;
operator ~/([a]) => true;
}
class Operators4 {
operator %({a}) => true;
operator &({a}) => true;
operator *({a}) => true;
operator +({a}) => true;
operator -({a}) => true;
operator /({a}) => true;
operator <({a}) => true;
operator <<({a}) => true;
operator <=({a}) => true;
operator ==({a}) => true;
operator >({a}) => true;
operator >=({a}) => true;
operator >>({a}) => true;
operator []({a}) => true;
operator []=({a, b}) => true;
operator ^({a}) => true;
operator |({a}) => true;
operator ~({a}) => true;
operator ~/({a}) => true;
}
class Operators5 {
operator %(a, [b]) => true;
operator &(a, [b]) => true;
operator *(a, [b]) => true;
operator +(a, [b]) => true;
operator -(a, [b]) => true;
operator /(a, [b]) => true;
operator <(a, [b]) => true;
operator <<(a, [b]) => true;
operator <=(a, [b]) => true;
operator ==(a, [b]) => true;
operator >(a, [b]) => true;
operator >=(a, [b]) => true;
operator >>(a, [b]) => true;
operator [](a, [b]) => true;
operator []=(a, b, [c]) => true;
operator ^(a, [b]) => true;
operator |(a, [b]) => true;
operator ~(a, [b]) => true;
operator ~/(a, [b]) => true;
}
class Operators6 {
operator %(a, {b}) => true;
operator &(a, {b}) => true;
operator *(a, {b}) => true;
operator +(a, {b}) => true;
operator -(a, {b}) => true;
operator /(a, {b}) => true;
operator <(a, {b}) => true;
operator <<(a, {b}) => true;
operator <=(a, {b}) => true;
operator ==(a, {b}) => true;
operator >(a, {b}) => true;
operator >=(a, {b}) => true;
operator >>(a, {b}) => true;
operator [](a, {b}) => true;
operator []=(a, b, {c}) => true;
operator ^(a, {b}) => true;
operator |(a, {b}) => true;
operator ~(a, {b}) => true;
operator ~/(a, {b}) => true;
}
class Operators7 {
operator %<T>(a) => true;
operator &<T>(a) => true;
operator *<T>(a) => true;
operator +<T>(a) => true;
operator -<T>() => true;
operator -<T>(a) => true;
operator /<T>(a) => true;
operator <<<T>(a) => true;
operator <=<T>(a) => true;
operator ==<T>(a) => true;
operator ><T>(a) => true;
operator >=<T>(a) => true;
operator >><T>(a) => true;
operator []<T>(a) => true;
operator []=<T>(a, b) => true;
operator ^<T>(a) => true;
operator |<T>(a) => true;
operator ~<T>() => true;
operator ~/<T>(a) => true;
}
main() {}

View file

@ -1,6 +0,0 @@
abstract class A {}
bad() {}
class B extends A {
B(): super()?.foo() {}
}
main() {}

View file

@ -1,46 +0,0 @@
import './issue41842_lib.dart' as lib;
class A<T> {
A();
factory A.foo1(int x) = B<T>;
factory A.foo2(int x) = B.foo<T>;
factory A.foo3(int x) = B<T>.foo;
factory A.foo4(int x) = lib.Foo<T>;
factory A.foo5(int x) = B.bar<T>;
factory A.foo6(int x) = B<T>.bar;
factory A.foo7(int x) = lib.Bar<T>;
factory A.foo8(int x) = lib.Foo.foo;
---- unknown chunk starts ----
<
---- unknown chunk ends ----
T;
factory A.foo10(int x) = lib.Foo.bar;
factory A.foo9(int x) = lib.Foo<T>.foo;
operator>();
---- unknown chunk starts ----
<
---- unknown chunk ends ----
T;
factory A.foo11(int x) = lib.Foo<T>.bar;
factory A.foo12(int x) = B<T>.foo;
operator>();
---- unknown chunk starts ----
<
---- unknown chunk ends ----
T;
factory A.foo13(int x) = B<T>.bar;
operator>();
---- unknown chunk starts ----
<
---- unknown chunk ends ----
T;
operator>();
}
class B<T> extends A<T> {
B(int x);
B.foo(int x);
factory B.bar(int x) => B.foo(x);
}
void main() {}

View file

@ -1,12 +0,0 @@
class E {
E() : this.named(), this.x = 1;
final int x;
final int y;
---- unknown chunk starts ----
this.
---- unknown chunk ends ----
E.named() : this.x = 5, this.y = 6;
y = 2;
}
main() {}

View file

@ -1,2 +0,0 @@
mixin M on Function() {}
void main() {}

View file

@ -12,8 +12,7 @@ class A1<X extends Function<T>()> {
class A2<X extends void Function<Y extends Function<T>()>()> {}
class A3<
X extends Function(void Function<Y extends Function(Function<T>())>())> {}
class A3< X extends Function(void Function<Y extends Function(Function<T>())>())> {}
foo1(Function<X extends Function<T>()>() f) {}
@ -37,8 +36,7 @@ typedef F3<X extends Function<T>()> = Function();
typedef F4<X extends Function<Y extends Function<T>()>()> = Function();
typedef F5<X extends Function(Function<Y extends Function(Function<T>())>())>
= Function();
typedef F5<X extends Function(Function<Y extends Function(Function<T>())>())> = Function();
class B1 {}

View file

@ -20,8 +20,7 @@ class A1<X extends Function<T>()> {
class A2<X extends void Function<Y extends Function<T>()>()> {}
class A3<
X extends Function(void Function<Y extends Function(Function<T>())>())> {}
class A3< X extends Function(void Function<Y extends Function(Function<T>())>())> {}
class B1 {}
@ -47,7 +46,6 @@ typedef F3<X extends Function<T>()> = Function();
typedef F4<X extends Function<Y extends Function<T>()>()> = Function();
typedef F5<X extends Function(Function<Y extends Function(Function<T>())>())>
= Function();
typedef F5<X extends Function(Function<Y extends Function(Function<T>())>())> = Function();
void set grault1(Function<X extends Function<T>()>() value) {}

View file

@ -1,3 +0,0 @@
// @dart = 2.16
enum T { t(); void test() { print("Success"); } }
void main() {}

View file

@ -1,3 +0,0 @@
// @dart = 2.16
enum T { t; const T.named(); }
void main() {}

View file

@ -1,3 +0,0 @@
class A = void Function() with M;
main() {}
mixin M {}

View file

@ -1,37 +0,0 @@
class A {
A(this.field);
int field;
}
class B implements A {
set field ()= ;
---- unknown chunk starts ----
0;
---- unknown chunk ends ----
get field => 0;
}
class C implements A {
get field() => 0;
set field() {}
}
class D implements A {
get field(a, b) => 0;
set field(a, b) {}
}
class E implements A {
get field([a]) => 0;
set field([a]) {}
}
class F implements A {
get field({a}) => 0;
set field({a}) {}
}
class G implements A {
get field(a) => 0;
set field (){}
}

View file

@ -1,2 +1,3 @@
enum A { a(0), b(1), final int value; const A(this.value); }
int fn(A a) => switch (a) { A.a => 0, A.b => 1, };

View file

@ -1,2 +1,3 @@
enum A { a(0), b(1), final int value; const A(this.value); }
int fn(A a) => switch (a) { A.a => 0, A.b => 1, };

View file

@ -1,10 +0,0 @@
// @dart = 2.13
abstract class Bar implements List<List<List<String>>> {}
class Foo {
Foo operator >>>(_) => this;
}
extension on Symbol {
String call(_) => "Called";
String operator >(_) => "Greater Than used";
}
main() {}

View file

@ -1,7 +0,0 @@
abstract macro class Class2 {}
abstract macro class Class4 = Super with Mixin;
class Super {}
macro class Class1 {}
macro class Class3 = Super with Mixin;
main() {}
mixin Mixin {}

View file

@ -1,5 +0,0 @@
// @dart = 2.19
abstract mixin class B {}
mixin M {}
mixin class A {}
mixin class C = Object with M;

View file

@ -48,14 +48,11 @@ typedef FconCyclicCoBound<X extends Function(X)> = Function(X);
typedef FinvCyclicCoBound<X extends Function(X)> = X Function(X);
class AcovCyclicCoBound<X extends FcovCyclicCoBound<Y>,
Y extends Function(Y)> {}
class AcovCyclicCoBound<X extends FcovCyclicCoBound<Y>, Y extends Function(Y)> {}
class AconCyclicCoBound<X extends FconCyclicCoBound<Y>,
Y extends Function(Y)> {}
class AconCyclicCoBound<X extends FconCyclicCoBound<Y>, Y extends Function(Y)> {}
class AinvCyclicCoBound<X extends FinvCyclicCoBound<Y>,
Y extends Function(Y)> {}
class AinvCyclicCoBound<X extends FinvCyclicCoBound<Y>, Y extends Function(Y)> {}
class B<X> {}

View file

@ -10,8 +10,7 @@ class AconBound<X extends FconBound<Y>, Y extends num> {}
class AconCyclicBound<X extends FconCyclicBound<Y>, Y extends A<Y>> {}
class AconCyclicCoBound<X extends FconCyclicCoBound<Y>,
Y extends Function(Y)> {}
class AconCyclicCoBound<X extends FconCyclicCoBound<Y>, Y extends Function(Y)> {}
class Acov<X extends Fcov<Y>, Y> {}
@ -19,8 +18,7 @@ class AcovBound<X extends FcovBound<Y>, Y extends num> {}
class AcovCyclicBound<X extends FcovCyclicBound<Y>, Y extends A<Y>> {}
class AcovCyclicCoBound<X extends FcovCyclicCoBound<Y>,
Y extends Function(Y)> {}
class AcovCyclicCoBound<X extends FcovCyclicCoBound<Y>, Y extends Function(Y)> {}
class Ainv<X extends Finv<Y>, Y> {}
@ -28,8 +26,7 @@ class AinvBound<X extends FinvBound<Y>, Y extends num> {}
class AinvCyclicBound<X extends FinvCyclicBound<Y>, Y extends A<Y>> {}
class AinvCyclicCoBound<X extends FinvCyclicCoBound<Y>,
Y extends Function(Y)> {}
class AinvCyclicCoBound<X extends FinvCyclicCoBound<Y>, Y extends Function(Y)> {}
class B<X> {}

View file

@ -1,7 +0,0 @@
// @dart = 2.18
(int, String) method1(int a, String b) => (a, b);
({int a, String b}) method4(int a, String b) => (a: a, b: b);
String method3([(int, String) record = const (0, '')]) => record.$2;
String method6([({int a, String b}) record = const (a: 0, b: '')]) => record.b;
int method2([(int, String) record = const (0, '')]) => record.$1;
int method5([({int a, String b}) record = const (a: 0, b: '')]) => record.a;

View file

@ -1,4 +0,0 @@
// @dart = 2.18
mixin M {}
sealed class A {}
sealed class B = Object with M;

View file

@ -5,7 +5,7 @@ library test;
class A {
final String foo;
A(this.foo);
bool operator ==(Object other) => other is A && other.foo == this.foo;
bool operator ==(Object other) => other is A && other . foo == this. foo;
}
main() {}

View file

@ -4,7 +4,7 @@ library test;
class A {
A(this.foo);
bool operator ==(Object other) => other is A && other.foo == this.foo;
bool operator ==(Object other) => other is A && other . foo == this. foo;
final String foo;
}

View file

@ -5,8 +5,7 @@ library test;
class A {
final String foo;
A(this.foo);
bool operator ==(Object other) =>
other is A && other.foo == this.foo && other.foo == this.foo;
bool operator ==(Object other) => other is A && other . foo == this. foo && other . foo == this. foo;
}
main() {}

View file

@ -4,8 +4,7 @@ library test;
class A {
A(this.foo);
bool operator ==(Object other) =>
other is A && other.foo == this.foo && other.foo == this.foo;
bool operator ==(Object other) => other is A && other . foo == this. foo && other . foo == this. foo;
final String foo;
}

View file

@ -2,6 +2,6 @@
library test;
String foo(obj) => obj is String ? obj.toUpperCase() : null;
String foo(obj) => obj is String ? obj . toUpperCase() : null;
main() {}

View file

@ -2,6 +2,6 @@
library test;
String foo(obj) => obj is String ? obj.toUpperCase() : null;
String foo(obj) => obj is String ? obj . toUpperCase() : null;
main() {}

View file

@ -2,6 +2,6 @@
library test;
void foo([List<String> list1 = const [], List<String> list2 = const [42]]) {}
void foo( [List<String> list1 = const [], List<String> list2 = const [ 42 ]]) {}
void main() {}

View file

@ -2,6 +2,6 @@
library test;
void foo([List<String> list1 = const [], List<String> list2 = const [42]]) {}
void foo( [List<String> list1 = const [], List<String> list2 = const [ 42 ]]) {}
void main() {}

View file

@ -2,9 +2,7 @@
library test;
void foo(
[Map<int, String> m1 = const {1: "hello"},
Map<int, String> m2 = const {"hello": "world"}]) {}
void foo( [Map<int, String> m1 = const {1: "hello"}, Map<int, String> m2 = const { "hello": "world" }]) {}
void test() {}

View file

@ -4,8 +4,6 @@ library test;
main() {}
void foo(
[Map<int, String> m1 = const {1: "hello"},
Map<int, String> m2 = const {"hello": "world"}]) {}
void foo( [Map<int, String> m1 = const {1: "hello"}, Map<int, String> m2 = const { "hello": "world" }]) {}
void test() {}

View file

@ -1,37 +0,0 @@
class C {
final int? _promotable;
final int? _notPromotable;
C(int i)
: _promotable = i,
_notPromotable = i;
static final staticPromotable =
((C c) => c._promotable != null ? c._promotable : 0)(new C(0));
static final staticNotPromotable =
((C c) => c._notPromotable != null ? c._notPromotable : 0)(new C(0));
final instancePromotable =
((C c) => c._promotable != null ? c._promotable : 0)(new C(0));
final instanceNotPromotable =
((C c) => c._notPromotable != null ? c._notPromotable : 0)(new C(0));
late final instancePromotableViaThis = _promotable != null ? _promotable : 0;
late final instanceNotPromotableViaThis =
_notPromotable != null ? _notPromotable : 0;
}
class D {
int? _notPromotable;
}
final topLevelPromotable =
((C c) => c._promotable != null ? c._promotable : 0)(new C(0));
final topLevelNotPromotable =
((C c) => c._notPromotable != null ? c._notPromotable : 0)(new C(0));
void acceptsInt(int x) {}
void testTopLevelPromotable() {}
void testTopLevelNotPromotable() {}
void testStaticPromotable() {}
void testStaticNotPromotable() {}
void testInstancePromotable(C c) {}
void testInstanceNotPromotable(C c) {}
void testInstancePromotableViaThis(C c) {}
void testInstanceNotPromotableViaThis(C c) {}
main() {}

View file

@ -1,37 +0,0 @@
class C {
C(int i)
: _promotable = i,
_notPromotable = i;
final instanceNotPromotable =
((C c) => c._notPromotable != null ? c._notPromotable : 0)(new C(0));
final instancePromotable =
((C c) => c._promotable != null ? c._promotable : 0)(new C(0));
final int? _notPromotable;
final int? _promotable;
late final instanceNotPromotableViaThis =
_notPromotable != null ? _notPromotable : 0;
late final instancePromotableViaThis = _promotable != null ? _promotable : 0;
static final staticNotPromotable =
((C c) => c._notPromotable != null ? c._notPromotable : 0)(new C(0));
static final staticPromotable =
((C c) => c._promotable != null ? c._promotable : 0)(new C(0));
}
class D {
int? _notPromotable;
}
final topLevelNotPromotable =
((C c) => c._notPromotable != null ? c._notPromotable : 0)(new C(0));
final topLevelPromotable =
((C c) => c._promotable != null ? c._promotable : 0)(new C(0));
main() {}
void acceptsInt(int x) {}
void testInstanceNotPromotable(C c) {}
void testInstanceNotPromotableViaThis(C c) {}
void testInstancePromotable(C c) {}
void testInstancePromotableViaThis(C c) {}
void testStaticNotPromotable() {}
void testStaticPromotable() {}
void testTopLevelNotPromotable() {}
void testTopLevelPromotable() {}

View file

@ -1,5 +1,3 @@
// @dart = 2.9
Future<void>
bar<T extends Future<num>, S, U extends num, V extends FutureOr<num>>(
T t, S s, U u, V v) async {}
Future<void> bar<T extends Future<num>, S, U extends num, V extends FutureOr<num>>( T t, S s, U u, V v) async {}

View file

@ -1,5 +1,3 @@
// @dart = 2.9
Future<void>
bar<T extends Future<num>, S, U extends num, V extends FutureOr<num>>(
T t, S s, U u, V v) async {}
Future<void> bar<T extends Future<num>, S, U extends num, V extends FutureOr<num>>( T t, S s, U u, V v) async {}

View file

@ -1,14 +1,27 @@
// @dart = 2.5
import 'inheritance_from_opt_in_lib.dart';
class LegacyClass1 extends Class1 {}
class LegacyClass2<T> extends Class2<T> {}
class LegacyClass3a<T> extends Class3<T> {}
class LegacyClass3b<T> extends Class3<T> implements GenericInterface<T> {}
class LegacyClass4a extends Class4a {}
class LegacyClass4b implements GenericInterface<num> {}
class LegacyClass4c implements GenericInterface<num?> {}
class LegacyClass4d extends Class4a implements GenericInterface<num> {}
class LegacyClass4e implements Class4a, Class4b {}
class LegacyClass5 extends Class5 implements GenericInterface<Object> {}
class LegacyClass6a<T> extends Class3<T> implements GenericSubInterface<T> {}
class LegacyClass6b<T> extends LegacyClass3a<T> implements GenericSubInterface<T> {}

View file

@ -1,9 +0,0 @@
import 'issue41597_lib.dart';
bool x;
bool x;
class C {
C.c0() : super();
C.c1() : super()!;
}
errors() {}
main() {}

View file

@ -6,7 +6,6 @@ import 'services_lib.dart';
import 'scheduler_lib.dart';
class TestSchedulerBinding extends BindingBase
with SchedulerBinding, ServicesBinding {}
class TestSchedulerBinding extends BindingBase with SchedulerBinding, ServicesBinding {}
main() {}

View file

@ -4,7 +4,6 @@ import 'foundation_lib.dart';
import 'scheduler_lib.dart';
import 'services_lib.dart';
class TestSchedulerBinding extends BindingBase
with SchedulerBinding, ServicesBinding {}
class TestSchedulerBinding extends BindingBase with SchedulerBinding, ServicesBinding {}
main() {}

View file

@ -8,10 +8,7 @@ class XToken extends Token {
const XToken();
}
const list = [
CP(Class),
VP.forToken(XToken(), 'Hello World'),
];
const list = [ CP(Class), VP.forToken(XToken(), 'Hello World'), ];
const m = M(list: list);

View file

@ -8,10 +8,7 @@ class XToken extends Token {
const XToken();
}
const list = [
CP(Class),
VP.forToken(XToken(), 'Hello World'),
];
const list = [ CP(Class), VP.forToken(XToken(), 'Hello World'), ];
const m = M(list: list);

View file

@ -2,9 +2,7 @@
class Class {
Map<String, Set<String>> map;
List<String> method(String node, Set<String> set) => set.add(node)
? [node, ...?map[node]?.expand((node) => method(node, set))?.toList()]
: [];
List<String> method(String node, Set<String> set) => set.add(node) ? [node, ...?map[node]?.expand((node) => method(node, set))?.toList()] : [];
}
main(args) {}

View file

@ -1,9 +1,7 @@
// @dart = 2.6
class Class {
List<String> method(String node, Set<String> set) => set.add(node)
? [node, ...?map[node]?.expand((node) => method(node, set))?.toList()]
: [];
List<String> method(String node, Set<String> set) => set.add(node) ? [node, ...?map[node]?.expand((node) => method(node, set))?.toList()] : [];
Map<String, Set<String>> map;
}

View file

@ -1,3 +0,0 @@
// @dart = 2.12
typedef A = int;
void main() {}

View file

@ -1,7 +0,0 @@
class C {
C c = new Object();
---- unknown chunk starts ----
)
---- unknown chunk ends ----
();
}

View file

@ -1,9 +0,0 @@
class A {
const A() : x = 'foo' {}
---- unknown chunk starts ----
:
---- unknown chunk ends ----
x = 'foo' ;
}
main() {}

View file

@ -1,7 +1,13 @@
// @dart = 2.9
(int, String b) topLevelFieldType = throw '';
(int, {String b}) topLevelMethodReturnType() => throw '';
const annotation = 1;
void method() {}
void topLevelMethodParameterType((String, @annotation int) o) {}
void topLevelSetterType(({@annotation int a, String b}) value) {}

View file

@ -1,19 +0,0 @@
x(){}
---- unknown chunk starts ----
.
---- unknown chunk ends ----
x(){}
y = 42;
---- unknown chunk starts ----
.
---- unknown chunk ends ----
main() {}
void foo() {}
z = true;

View file

@ -1,9 +0,0 @@
library lib;
part '$foo';
part '$foo/bar';
part '$for/bar';
part '${true}';
part 'the${1}thing';
part 'part_$foo${'a'}.dart';
part 'part_${'a'}_$foo.dart';
main() {}

View file

@ -1,8 +0,0 @@
abstract class A {}
bad() {}
class B extends A {
B(): super().foo() {}
B.named1(): super().super() {}
B.named2(): super().() {}
}
main() {}

View file

@ -1,13 +0,0 @@
---- unknown chunk starts ----
<
---- unknown chunk ends ----
Future<List<>> f3() async {}
f2() async => null;
foo< int >f1() {}
foo Future<List<int>> (){}
main() async {}

View file

@ -16,10 +16,7 @@ final int finalTopLevelFieldWithInitializer1 = init(87);
int finalTopLevelFieldWithInitializer2Init = 0;
final int finalTopLevelFieldWithInitializer2 =
finalTopLevelFieldWithInitializer2Init++ == 0
? finalTopLevelFieldWithInitializer2 + 1
: 87;
final int finalTopLevelFieldWithInitializer2 = finalTopLevelFieldWithInitializer2Init++ == 0 ? finalTopLevelFieldWithInitializer2 + 1 : 87;
class Class {
static const int staticConstField = 123;
@ -29,10 +26,7 @@ class Class {
static int staticFieldWithInitializer2 = init(55);
static final int staticFinalFieldWithInitializer1 = init(73);
static int staticFinalFieldWithInitializer2Init = 0;
static final int staticFinalFieldWithInitializer2 =
staticFinalFieldWithInitializer2Init++ == 0
? staticFinalFieldWithInitializer2 + 1
: 87;
static final int staticFinalFieldWithInitializer2 = staticFinalFieldWithInitializer2Init++ == 0 ? staticFinalFieldWithInitializer2 + 1 : 87;
}
main() {}

View file

@ -6,10 +6,7 @@ class Class {
int instanceFieldWithInitializer = init(55);
static const int staticConstField = 123;
static final int staticFinalFieldWithInitializer1 = init(73);
static final int staticFinalFieldWithInitializer2 =
staticFinalFieldWithInitializer2Init++ == 0
? staticFinalFieldWithInitializer2 + 1
: 87;
static final int staticFinalFieldWithInitializer2 = staticFinalFieldWithInitializer2Init++ == 0 ? staticFinalFieldWithInitializer2 + 1 : 87;
static int staticFieldWithInitializer1 = init(55);
static int staticFieldWithInitializer2 = init(55);
static int staticFieldWithoutInitializer;
@ -24,10 +21,7 @@ expect(expected, actual) {}
final int finalTopLevelFieldWithInitializer1 = init(87);
final int finalTopLevelFieldWithInitializer2 =
finalTopLevelFieldWithInitializer2Init++ == 0
? finalTopLevelFieldWithInitializer2 + 1
: 87;
final int finalTopLevelFieldWithInitializer2 = finalTopLevelFieldWithInitializer2Init++ == 0 ? finalTopLevelFieldWithInitializer2 + 1 : 87;
int finalTopLevelFieldWithInitializer2Init = 0;

View file

@ -1,8 +0,0 @@
class A {
A(int foo<T>(int a));
}
class B extends A {
B.sub1(double super.bar1<T1>(int a1),);
B.sub2(double super.bar2<T2>(int a2),);
}
main() {}

View file

@ -1,9 +0,0 @@
// @dart = 2.15
class A {
A(this.field);
int field;
}
class B extends A {
B(super.field);
}
main() {}

View file

@ -1,7 +0,0 @@
class A {
A(String x);
}
class B extends A {
B(var super.x);
}
main() {}

View file

@ -17,7 +17,6 @@ extension_types/issue53625: FormatterCrash
extension_types/representation: FormatterCrash
general/base_class_declaration: FormatterCrash
general/constants/non_const_constructor: FormatterCrash
general/constants/various: FormatterCrash
general/constants/various2: FormatterCrash
general/enum_super_constructor: FormatterCrash
general/extension_type_declaration_disabled: FormatterCrash
@ -32,15 +31,10 @@ general/issue48487b: FormatterCrash
general/issue48919: FormatterCrash
general/macro_class: FormatterCrash
general/mixin_class_declaration: FormatterCrash
general/null_safety_invalid_experiment_and_language_version: FormatterCrash
general/null_safety_invalid_experiment: FormatterCrash
general/records_opt_out: FormatterCrash
general/sealed_class_declaration: FormatterCrash
nnbd_mixed/inheritance_from_opt_in: FormatterCrash
nnbd_mixed/issue41597: FormatterCrash
nnbd_mixed/null_safety_invalid_language_version: FormatterCrash
nonfunction_type_aliases/old_version: FormatterCrash
records/record_type_unsupported: FormatterCrash
regress/issue_30994: FormatterCrash
regress/issue_31198: FormatterCrash
super_parameters/opt_out: FormatterCrash
@ -63,9 +57,16 @@ regress/issue_39035.crash: EmptyOutput
regress/issue_39091_2: EmptyOutput
regress/utf_16_le_content.crash: EmptyOutput
extension_types/with_dependencies/issue53209_2/main: UnknownChunk
general/bad_import: UnknownChunk # Test has parser errors
general/error_recovery/constructor_recovery_operator.crash: UnknownChunk # Test has parser errors
general/error_recovery/issue_39058_prime.crash: UnknownChunk # Test has parser errors
general/error_recovery/issue_39202.crash: UnknownChunk # Test has parser errors
general/factory_var: UnknownChunk # Test has parser errors
general/issue41842: UnknownChunk # Test has parser errors
general/issue43363: UnknownChunk # Test has parser errors
general/issue54006: UnknownChunk # Test has parser errors
rasta/issue_000046: UnknownChunk # Test has parser errors
rasta/malformed_const_constructor: UnknownChunk # Test has parser errors
regress/ambiguous_builder_01: UnknownChunk # Test has parser errors
regress/issue_34850: UnknownChunk # Test has parser errors
extension_types/with_dependencies/issue53209_2/main: UnknownChunk

View file

@ -1,22 +0,0 @@
class Operators1 {
operator >>>() => true;
}
class Operators2 {
operator >>>(a, b) => true;
}
class Operators3 {
operator >>>([a]) => true;
}
class Operators4 {
operator >>>({a}) => true;
}
class Operators5 {
operator >>>(a, [b]) => true;
}
class Operators6 {
operator >>>(a, {b}) => true;
}
class Operators7 {
operator >>><T>(a) => true;
}
main() {}