Version 2.14.0-151.0.dev
Merge commit '633f14878825d51ae7e1e70967521b391233d5f4' into 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e74f84b..f8c7ddd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -50,7 +50,15 @@
#### Dart command line
-- The `dart create` command has been updated to create projects that use the new
+* **Breaking Change** [#46100][]: The standalone `dart2native` has been marked
+deprecated, and now prints a warning message. It's replacement is the `dart
+compile exe` and `dart compile aot-snapshot` commands, which offer the same
+functionality. The `dart2native` tool will be discontinued (removed from the
+Dart SDK) in Dart 2.15.
+
+https://github.com/dart-lang/sdk/issues/46100
+
+* The `dart create` command has been updated to create projects that use the new
'core' set of lints from `package:lints`. See https://dart.dev/go/core-lints
for more information about these lints.
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart b/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart
index 1402102..d23309d7 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart
@@ -781,6 +781,11 @@
}
@override
+ void handleTypeArgumentApplication(Token openAngleBracket) {
+ listener?.handleTypeArgumentApplication(openAngleBracket);
+ }
+
+ @override
void endHide(Token hideKeyword) {
listener?.endHide(hideKeyword);
}
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart b/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
index 0e08a2e..9d7de10 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
@@ -1727,4 +1727,19 @@
/// This event is generated by the parser when the parser's
/// `parseOneCommentReference` method is called.
void handleNoCommentReference() {}
+
+ /// An expression was encountered consisting of type arguments applied to a
+ /// subexpression. This could validly represent any of the following:
+ /// - A type literal (`var x = List<int>;`)
+ /// - A function tear-off with type arguments (`var x = f<int>;` or
+ /// `var x = importPrefix.f<int>;`)
+ /// - A static method tear-off with type arguments (`var x = ClassName.m<int>`
+ /// or `var x = importPrefix.ClassName.m<int>;`)
+ /// - An instance method tear-off with type arguments (`var x = EXPR.m<int>;`)
+ ///
+ /// Or, in the event of invalid code, it could represent type arguments
+ /// erroneously applied to some other expression type (e.g.
+ /// `var x = (f)<int>;`). The client is responsible for reporting an error if
+ /// this occurs.
+ void handleTypeArgumentApplication(Token openAngleBracket) {}
}
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
index ba63e91..b8eb480 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
@@ -4793,7 +4793,10 @@
listener.handleNonNullAssertExpression(bangToken);
}
token = typeArg.parseArguments(bangToken, this);
- assert(optional('(', token.next!));
+ if (!optional('(', token.next!)) {
+ listener.handleTypeArgumentApplication(bangToken.next!);
+ typeArg = noTypeParamOrArg;
+ }
}
return _parsePrecedenceExpressionLoop(
@@ -4861,7 +4864,10 @@
listener.handleNonNullAssertExpression(bangToken);
}
token = typeArg.parseArguments(bangToken, this);
- assert(optional('(', token.next!));
+ if (!optional('(', token.next!)) {
+ listener.handleTypeArgumentApplication(bangToken.next!);
+ typeArg = noTypeParamOrArg;
+ }
}
} else if (identical(type, TokenType.OPEN_PAREN) ||
identical(type, TokenType.OPEN_SQUARE_BRACKET)) {
@@ -5174,8 +5180,13 @@
TypeParamOrArgInfo typeArg = computeTypeParamOrArg(identifier);
if (typeArg != noTypeParamOrArg) {
Token endTypeArguments = typeArg.skip(identifier);
- if (optional(".", endTypeArguments.next!)) {
- return parseImplicitCreationExpression(token, typeArg);
+ Token afterTypeArguments = endTypeArguments.next!;
+ if (optional(".", afterTypeArguments)) {
+ Token afterPeriod = afterTypeArguments.next!;
+ if (afterPeriod.isIdentifier &&
+ optional('(', afterPeriod.next!)) {
+ return parseImplicitCreationExpression(token, typeArg);
+ }
}
}
}
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart b/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart
index ecacdd9..03a290d 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart
@@ -348,7 +348,53 @@
/// possible other constructs will pass (e.g., 'a < C, D > 3').
TypeParamOrArgInfo computeMethodTypeArguments(Token token) {
TypeParamOrArgInfo typeArg = computeTypeParamOrArg(token);
- return optional('(', typeArg.skip(token).next!) && !typeArg.recovered
+ return mayFollowTypeArgs(typeArg.skip(token).next!) && !typeArg.recovered
? typeArg
: noTypeParamOrArg;
}
+
+/// Indicates whether the given [token] is allowed to follow a list of type
+/// arguments used as a selector after an expression.
+///
+/// This is used for disambiguating constructs like `f(a<b,c>(d))` and
+/// `f(a<b,c>-d)`. In the case of `f(a<b,c>(d))`, `true` will be returned,
+/// indicating that the `<` and `>` should be interpreted as delimiting type
+/// arguments (so one argument is being passed to `f` -- a call to the generic
+/// function `a`). In the case of `f(a<b,c>-d)`, `false` will be returned,
+/// indicating that the `<` and `>` should be interpreted as operators (so two
+/// arguments are being passed to `f`: `a < b` and `c > -d`).
+bool mayFollowTypeArgs(Token token) {
+ const Set<String> tokensThatMayFollowTypeArg = {
+ '(',
+ ')',
+ ']',
+ '}',
+ ':',
+ ';',
+ ',',
+ '.',
+ '?',
+ '==',
+ '!=',
+ '..',
+ '?.',
+ '??',
+ '?..',
+ '&',
+ '|',
+ '^',
+ '+',
+ '*',
+ '%',
+ '/',
+ '~/'
+ };
+ if (token.type == TokenType.EOF) {
+ // The spec doesn't have anything to say about this case, since an
+ // expression can't occur at the end of a file, but for testing it's to our
+ // advantage to allow EOF after type arguments, so that an isolated `f<x>`
+ // can be parsed as an expression.
+ return true;
+ }
+ return tokensThatMayFollowTypeArg.contains(token.lexeme);
+}
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 56ca0de..344f997 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -46,8 +46,8 @@
import 'package:analyzer/exception/exception.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
-import 'package:analyzer/src/dart/analysis/driver.dart' as nd;
-import 'package:analyzer/src/dart/analysis/status.dart' as nd;
+import 'package:analyzer/src/dart/analysis/driver.dart' as analysis;
+import 'package:analyzer/src/dart/analysis/status.dart' as analysis;
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/util/file_paths.dart' as file_paths;
@@ -340,7 +340,7 @@
/// Send status notification to the client. The state of analysis is given by
/// the [status] information.
- void sendStatusNotificationNew(nd.AnalysisStatus status) {
+ void sendStatusNotificationNew(analysis.AnalysisStatus status) {
if (status.isAnalyzing) {
_onAnalysisStartedController.add(true);
}
@@ -677,7 +677,7 @@
}
@override
- void listenAnalysisDriver(nd.AnalysisDriver analysisDriver) {
+ void listenAnalysisDriver(analysis.AnalysisDriver analysisDriver) {
analysisDriver.results.listen((result) {
var path = result.path!;
filesToFlush.add(path);
diff --git a/pkg/analysis_server/lib/src/analysis_server_abstract.dart b/pkg/analysis_server/lib/src/analysis_server_abstract.dart
index 448bc17..b884c5f 100644
--- a/pkg/analysis_server/lib/src/analysis_server_abstract.dart
+++ b/pkg/analysis_server/lib/src/analysis_server_abstract.dart
@@ -37,7 +37,7 @@
import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/src/dart/analysis/byte_store.dart';
-import 'package:analyzer/src/dart/analysis/driver.dart' as nd;
+import 'package:analyzer/src/dart/analysis/driver.dart' as analysis;
import 'package:analyzer/src/dart/analysis/file_byte_store.dart'
show EvictingFileByteStore;
import 'package:analyzer/src/dart/analysis/performance_logger.dart';
@@ -80,7 +80,7 @@
late ByteStore byteStore;
- late nd.AnalysisDriverScheduler analysisDriverScheduler;
+ late analysis.AnalysisDriverScheduler analysisDriverScheduler;
DeclarationsTracker? declarationsTracker;
DeclarationsTrackerData? declarationsTrackerData;
@@ -182,7 +182,7 @@
byteStore = createByteStore(resourceProvider);
- analysisDriverScheduler = nd.AnalysisDriverScheduler(
+ analysisDriverScheduler = analysis.AnalysisDriverScheduler(
analysisPerformanceLogger,
driverWatcher: pluginWatcher);
@@ -212,7 +212,8 @@
}
/// A table mapping [Folder]s to the [AnalysisDriver]s associated with them.
- Map<Folder, nd.AnalysisDriver> get driverMap => contextManager.driverMap;
+ Map<Folder, analysis.AnalysisDriver> get driverMap =>
+ contextManager.driverMap;
/// Return the total time the server's been alive.
Duration get uptime {
@@ -255,7 +256,7 @@
/// Return an analysis driver to which the file with the given [path] is
/// added if one exists, otherwise a driver in which the file was analyzed if
/// one exists, otherwise the first driver, otherwise `null`.
- nd.AnalysisDriver? getAnalysisDriver(String path) {
+ analysis.AnalysisDriver? getAnalysisDriver(String path) {
var drivers = driverMap.values.toList();
if (drivers.isNotEmpty) {
// Sort the drivers so that more deeply nested contexts will be checked
@@ -395,7 +396,7 @@
return contextManager.isAnalyzed(path);
}
- void logExceptionResult(nd.ExceptionResult result) {
+ void logExceptionResult(analysis.ExceptionResult result) {
var message = 'Analysis failed: ${result.filePath}';
if (result.contextKey != null) {
message += ' context: ${result.contextKey}';
diff --git a/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart b/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart
index 9958c9b..17d912b 100644
--- a/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart
+++ b/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart
@@ -42,8 +42,8 @@
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/source/line_info.dart';
-import 'package:analyzer/src/dart/analysis/driver.dart' as nd;
-import 'package:analyzer/src/dart/analysis/status.dart' as nd;
+import 'package:analyzer/src/dart/analysis/driver.dart' as analysis;
+import 'package:analyzer/src/dart/analysis/status.dart' as analysis;
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/util/file_paths.dart' as file_paths;
import 'package:analyzer_plugin/protocol/protocol_common.dart' as plugin;
@@ -543,7 +543,7 @@
/// Send status notification to the client. The state of analysis is given by
/// the [status] information.
- Future<void> sendStatusNotification(nd.AnalysisStatus status) async {
+ Future<void> sendStatusNotification(analysis.AnalysisStatus status) async {
// Send old custom notifications to clients that do not support $/progress.
// TODO(dantup): Remove this custom notification (and related classes) when
// it's unlikely to be in use by any clients.
@@ -815,7 +815,7 @@
}
@override
- void listenAnalysisDriver(nd.AnalysisDriver analysisDriver) {
+ void listenAnalysisDriver(analysis.AnalysisDriver analysisDriver) {
// TODO(dantup): Is this required, or covered by
// addContextsToDeclarationsTracker? The original server does not appear to
// have an equivalent call.
diff --git a/pkg/analyzer/lib/dart/analysis/features.dart b/pkg/analyzer/lib/dart/analysis/features.dart
index 4fa69d3..d03e08c 100644
--- a/pkg/analyzer/lib/dart/analysis/features.dart
+++ b/pkg/analyzer/lib/dart/analysis/features.dart
@@ -16,6 +16,9 @@
/// Feature information for non-nullability by default.
static final non_nullable = ExperimentalFeatures.non_nullable;
+ /// Feature information for constructor tear-offs.
+ static final constructor_tearoffs = ExperimentalFeatures.constructor_tearoffs;
+
/// Feature information for control flow collections.
static final control_flow_collections =
ExperimentalFeatures.control_flow_collections;
diff --git a/pkg/analyzer/lib/dart/sdk/build_sdk_summary.dart b/pkg/analyzer/lib/dart/sdk/build_sdk_summary.dart
index 486a073..c54627b 100644
--- a/pkg/analyzer/lib/dart/sdk/build_sdk_summary.dart
+++ b/pkg/analyzer/lib/dart/sdk/build_sdk_summary.dart
@@ -136,9 +136,15 @@
CompilationUnit definingUnit = _parse(source);
inputUnits.add(
- LinkInputUnit(null, source, false, definingUnit),
+ LinkInputUnit.tmp1(
+ partDirectiveIndex: null,
+ source: source,
+ isSynthetic: false,
+ unit: definingUnit,
+ ),
);
+ var partDirectiveIndex = 0;
for (Directive directive in definingUnit.directives) {
if (directive is NamespaceDirective) {
String libUri = directive.uri.stringValue!;
@@ -149,13 +155,22 @@
Source partSource = context.sourceFactory.resolveUri(source, partUri)!;
CompilationUnit partUnit = _parse(partSource);
inputUnits.add(
- LinkInputUnit(partUri, partSource, false, partUnit),
+ LinkInputUnit.tmp1(
+ partUriStr: partUri,
+ partDirectiveIndex: partDirectiveIndex++,
+ source: partSource,
+ isSynthetic: false,
+ unit: partUnit,
+ ),
);
}
}
inputLibraries.add(
- LinkInputLibrary(source, inputUnits),
+ LinkInputLibrary.tmp1(
+ source: source,
+ units: inputUnits,
+ ),
);
}
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 5f2b5b9..e05a519 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -45,7 +45,6 @@
var counterFileStateRefresh = 0;
var counterUnlinkedBytes = 0;
var counterUnlinkedLinkedBytes = 0;
-int fileObjectId = 0;
var timerFileStateRefresh = Stopwatch();
/// A library from [SummaryDataStore].
@@ -117,9 +116,6 @@
/// The language version for the package that contains this file.
final Version packageLanguageVersion;
- int id = fileObjectId++;
- int? refreshId;
-
bool? _exists;
String? _content;
String? _contentHash;
@@ -417,7 +413,6 @@
/// Return `true` if the API signature changed since the last refresh.
bool refresh({bool allowCached = false}) {
counterFileStateRefresh++;
- refreshId = fileObjectId++;
var timerWasRunning = timerFileStateRefresh.isRunning;
if (!timerWasRunning) {
@@ -515,7 +510,7 @@
@override
String toString() {
- return '[id: $id][rid: $refreshId]$uri = $path';
+ return '$uri = $path';
}
/// Return the [FileState] for the given [relativeUri], or `null` if the
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_context.dart b/pkg/analyzer/lib/src/dart/analysis/library_context.dart
index 9cea8d5..8fc9a4a 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_context.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_context.dart
@@ -38,7 +38,6 @@
class LibraryContext {
static const _maxLinkedDataInBytes = 64 * 1024 * 1024;
- final int id = fileObjectId++;
final LibraryContextTestView testView;
final PerformanceLog logger;
final ByteStore byteStore;
@@ -100,21 +99,15 @@
var bytesGet = 0;
var bytesPut = 0;
- var thisLoadLogBuffer = StringBuffer();
-
- void loadBundle(LibraryCycle cycle, String debugPrefix) {
+ void loadBundle(LibraryCycle cycle) {
if (cycle.libraries.isEmpty ||
elementFactory.hasLibrary(cycle.libraries.first.uriStr)) {
return;
}
- thisLoadLogBuffer.writeln('$debugPrefix$cycle');
-
librariesTotal += cycle.libraries.length;
- cycle.directDependencies.forEach(
- (e) => loadBundle(e, '$debugPrefix '),
- );
+ cycle.directDependencies.forEach(loadBundle);
var unitsInformativeBytes = <Uri, Uint8List>{};
for (var library in cycle.libraries) {
@@ -152,55 +145,22 @@
partIndex++;
inputUnits.add(
- link2.LinkInputUnit(
- partUriStr,
- file.source,
- isSynthetic,
- unit,
+ link2.LinkInputUnit.tmp1(
+ // TODO(scheglov) bad, group part data
+ partDirectiveIndex: partIndex - 1,
+ partUriStr: partUriStr,
+ source: file.source,
+ isSynthetic: isSynthetic,
+ unit: unit,
),
);
-
- // TODO(scheglov) remove after fixing linking issues
- {
- var existingLibraryReference =
- elementFactory.rootReference[libraryFile.uriStr];
- if (existingLibraryReference != null) {
- var existingElement =
- existingLibraryReference.element as LibraryElement?;
- if (existingElement != null) {
- var buffer = StringBuffer();
-
- buffer.writeln('[The library is already loaded]');
- buffer.writeln();
-
- var existingSource = existingElement.source;
- buffer.writeln('[oldUri: ${existingSource.uri}]');
- buffer.writeln('[oldPath: ${existingSource.fullName}]');
- buffer.writeln('[newUri: ${libraryFile.uriStr}]');
- buffer.writeln('[newPath: ${libraryFile.path}]');
- buffer.writeln('[cycle: $cycle]');
- buffer.writeln();
-
- buffer.writeln('Bundles loaded in this load2() invocation:');
- buffer.writeln(thisLoadLogBuffer);
- buffer.writeln();
-
- var libraryRefs = elementFactory.rootReference.children;
- var libraryUriList = libraryRefs.map((e) => e.name).toList();
- buffer.writeln('[elementFactory.libraries: $libraryUriList]');
-
- throw CaughtExceptionWithFiles(
- 'Cycle loading state error',
- StackTrace.current,
- {'status': buffer.toString()},
- );
- }
- }
- }
}
inputLibraries.add(
- link2.LinkInputLibrary(librarySource, inputUnits),
+ link2.LinkInputLibrary.tmp1(
+ source: librarySource,
+ units: inputUnits,
+ ),
);
}
inputsTimer.stop();
@@ -240,7 +200,7 @@
logger.run('Prepare linked bundles', () {
var libraryCycle = targetLibrary.libraryCycle;
- loadBundle(libraryCycle, '');
+ loadBundle(libraryCycle);
logger.writeln(
'[librariesTotal: $librariesTotal]'
'[librariesLoaded: $librariesLoaded]'
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_graph.dart b/pkg/analyzer/lib/src/dart/analysis/library_graph.dart
index d21d4e1..413d6ab 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_graph.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_graph.dart
@@ -19,8 +19,6 @@
/// Information about libraries that reference each other, so form a cycle.
class LibraryCycle {
- final int id = fileObjectId++;
-
/// The libraries that belong to this cycle.
final List<FileState> libraries = [];
@@ -68,7 +66,7 @@
@override
String toString() {
- return '[[id: $id] ' + libraries.join(', ') + ']';
+ return '[' + libraries.join(', ') + ']';
}
}
diff --git a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart
index bebd7f3..cc4db0c 100644
--- a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart
+++ b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart
@@ -4,7 +4,8 @@
import 'dart:math' as math;
-import 'package:analyzer/dart/ast/ast.dart' show AstNode, ConstructorName;
+import 'package:analyzer/dart/ast/ast.dart'
+ show Annotation, AstNode, ConstructorName;
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/error/listener.dart' show ErrorReporter;
@@ -209,11 +210,12 @@
if (inferred is FunctionType &&
inferred.typeFormals.isNotEmpty &&
- !genericMetadataIsEnabled) {
+ !genericMetadataIsEnabled &&
+ errorReporter != null) {
if (failAtError) return null;
var typeFormals = inferred.typeFormals;
var typeFormalsStr = typeFormals.map(_elementStr).join(', ');
- errorReporter?.reportErrorForNode(
+ errorReporter.reportErrorForNode(
CompileTimeErrorCode.COULD_NOT_INFER, errorNode!, [
parameter.name,
' Inferred candidate type ${_typeStr(inferred)} has type parameters'
@@ -229,20 +231,11 @@
// by [infer], with [typeParam] filled in as its bounds. This is
// considered a failure of inference, under the "strict-inference"
// mode.
- if (errorNode is ConstructorName &&
- !(errorNode.type.type as InterfaceType)
- .element
- .hasOptionalTypeArgs) {
- String constructorName = errorNode.name == null
- ? errorNode.type.name.name
- : '${errorNode.type}.${errorNode.name}';
- errorReporter?.reportErrorForNode(
- HintCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION,
- errorNode,
- [constructorName]);
- }
- // TODO(srawlins): More inference failure cases, like functions, and
- // function expressions.
+ _reportInferenceFailure(
+ errorReporter: errorReporter,
+ errorNode: errorNode,
+ genericMetadataIsEnabled: genericMetadataIsEnabled,
+ );
}
}
@@ -486,6 +479,43 @@
}
}
+ /// Reports an inference failure on [errorNode] according to its type.
+ void _reportInferenceFailure({
+ ErrorReporter? errorReporter,
+ AstNode? errorNode,
+ required bool genericMetadataIsEnabled,
+ }) {
+ if (errorReporter == null || errorNode == null) {
+ return;
+ }
+ if (errorNode is ConstructorName &&
+ !(errorNode.type.type as InterfaceType).element.hasOptionalTypeArgs) {
+ String constructorName = errorNode.name == null
+ ? errorNode.type.name.name
+ : '${errorNode.type}.${errorNode.name}';
+ errorReporter.reportErrorForNode(
+ HintCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION,
+ errorNode,
+ [constructorName]);
+ } else if (errorNode is Annotation) {
+ if (genericMetadataIsEnabled) {
+ // Only report an error if generic metadata is valid syntax.
+ var element = errorNode.name.staticElement;
+ if (element != null && !element.hasOptionalTypeArgs) {
+ String constructorName = errorNode.constructorName == null
+ ? errorNode.name.name
+ : '${errorNode.name.name}.${errorNode.constructorName}';
+ errorReporter.reportErrorForNode(
+ HintCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION,
+ errorNode,
+ [constructorName]);
+ }
+ }
+ }
+ // TODO(srawlins): More inference failure cases, like functions, and
+ // function expressions.
+ }
+
/// If in a legacy library, return the legacy version of the [type].
/// Otherwise, return the original type.
DartType _toLegacyElementIfOptOut(DartType type) {
diff --git a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
index a175010..6ce2ccd 100644
--- a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
+++ b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
@@ -862,17 +862,22 @@
partIndex++;
inputUnits.add(
- link2.LinkInputUnit(
- partUriStr,
- file.source,
- isSynthetic,
- unit,
+ link2.LinkInputUnit.tmp1(
+ // TODO(scheglov) bad, group part data
+ partDirectiveIndex: partIndex - 1,
+ partUriStr: partUriStr,
+ source: file.source,
+ isSynthetic: isSynthetic,
+ unit: unit,
),
);
}
inputLibraries.add(
- link2.LinkInputLibrary(librarySource, inputUnits),
+ link2.LinkInputLibrary.tmp1(
+ source: librarySource,
+ units: inputUnits,
+ ),
);
}
inputsTimer.stop();
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index aefa6c7..e46200b 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -140,6 +140,9 @@
/// `true` if variance behavior is enabled
final bool enableVariance;
+ /// `true` if constructor tearoffs are enabled
+ final bool enableConstructorTearoffs;
+
final FeatureSet _featureSet;
AstBuilder(ErrorReporter errorReporter, this.fileUri, this.isFullAst,
@@ -155,6 +158,8 @@
enableNonFunctionTypeAliases =
_featureSet.isEnabled(Feature.nonfunction_type_aliases),
enableVariance = _featureSet.isEnabled(Feature.variance),
+ enableConstructorTearoffs =
+ _featureSet.isEnabled(Feature.constructor_tearoffs),
uri = uri ?? fileUri;
NodeList<ClassMember> get currentDeclarationMembers {
@@ -3514,6 +3519,39 @@
}
@override
+ void handleTypeArgumentApplication(Token openAngleBracket) {
+ var typeArguments = pop() as TypeArgumentList;
+ var receiver = pop() as Expression;
+ if (!enableConstructorTearoffs) {
+ var feature = ExperimentalFeatures.constructor_tearoffs;
+ handleRecoverableError(
+ templateExperimentNotEnabled.withArguments(
+ feature.enableString,
+ _versionAsString(ExperimentStatus.currentVersion),
+ ),
+ typeArguments.leftBracket,
+ typeArguments.rightBracket,
+ );
+ // Since analyzer visitors don't yet support constructor tear-offs, create
+ // a FunctionExpressionInvocation with a synthetic argument list instead.
+ // TODO(paulberry): once we have visitor support for constructor
+ // tear-offs, fall through and return a FunctionReference instead since
+ // that should lead to better quality error recovery.
+ var syntheticOffset = typeArguments.rightBracket.end;
+ push(ast.functionExpressionInvocation(
+ receiver,
+ typeArguments,
+ ast.argumentList(
+ SyntheticToken(TokenType.OPEN_PAREN, syntheticOffset),
+ [],
+ SyntheticToken(TokenType.CLOSE_PAREN, syntheticOffset))));
+ return;
+ }
+ push(ast.functionReference(
+ function: receiver, typeArguments: typeArguments));
+ }
+
+ @override
void handleTypeVariablesDefined(Token token, int count) {
debugEvent("handleTypeVariablesDefined");
assert(count > 0);
diff --git a/pkg/analyzer/lib/src/summary2/link.dart b/pkg/analyzer/lib/src/summary2/link.dart
index 225b860..cc67f58 100644
--- a/pkg/analyzer/lib/src/summary2/link.dart
+++ b/pkg/analyzer/lib/src/summary2/link.dart
@@ -238,29 +238,45 @@
final Source source;
final List<LinkInputUnit> units;
+ @Deprecated('Use LinkInputLibrary.tmp1() with instead')
LinkInputLibrary(this.source, this.units);
+ LinkInputLibrary.tmp1({
+ required this.source,
+ required this.units,
+ });
+
Uri get uri => source.uri;
String get uriStr => '$uri';
}
class LinkInputUnit {
+ final int? partDirectiveIndex;
final String? partUriStr;
final Source source;
final bool isSynthetic;
final ast.CompilationUnit unit;
+ @Deprecated('Use LinkInputUnit.tmp1() with instead')
LinkInputUnit(
this.partUriStr,
this.source,
this.isSynthetic,
this.unit,
- );
+ ) : partDirectiveIndex = null;
- String get uriStr {
- return '${source.uri}';
- }
+ LinkInputUnit.tmp1({
+ required this.partDirectiveIndex,
+ this.partUriStr,
+ required this.source,
+ required this.isSynthetic,
+ required this.unit,
+ });
+
+ Uri get uri => source.uri;
+
+ String get uriStr => '$uri';
}
class LinkResult {
diff --git a/pkg/analyzer/test/generated/function_reference_parser_test.dart b/pkg/analyzer/test/generated/function_reference_parser_test.dart
new file mode 100644
index 0000000..fe9091f
--- /dev/null
+++ b/pkg/analyzer/test/generated/function_reference_parser_test.dart
@@ -0,0 +1,357 @@
+// Copyright (c) 2021, 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:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/error/syntactic_errors.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'parser_test_base.dart';
+
+main() {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(FunctionReferenceParserTest);
+ });
+}
+
+/// Tests exercising the fasta parser's handling of generic instantiations.
+@reflectiveTest
+class FunctionReferenceParserTest extends FastaParserTestCase {
+ /// Verifies that the given [node] matches `f<a, b>`.
+ void expect_f_a_b(AstNode node) {
+ var functionReference = node as FunctionReference;
+ expect((functionReference.function as SimpleIdentifier).name, 'f');
+ var typeArgs = functionReference.typeArguments!.arguments;
+ expect(typeArgs, hasLength(2));
+ expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
+ expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
+ }
+
+ void expect_two_args(MethodInvocation methodInvocation) {
+ var arguments = methodInvocation.argumentList.arguments;
+ expect(arguments, hasLength(2));
+ expect(arguments[0], TypeMatcher<BinaryExpression>());
+ expect(arguments[1], TypeMatcher<BinaryExpression>());
+ }
+
+ void test_feature_disabled() {
+ var expression =
+ (parseStatement('f<a, b>;', featureSet: preConstructorTearoffs)
+ as ExpressionStatement)
+ .expression;
+ // TODO(paulberry): once we have visitor support for FunctionReference, this
+ // should be parsed as a FunctionReference, so we should be able to validate
+ // it using `expect_f_a_b`. But for now it's parsed as a
+ // FunctionExpressionInvocation with synthetic arguments.
+ var functionExpressionInvocation =
+ expression as FunctionExpressionInvocation;
+ expect(
+ (functionExpressionInvocation.function as SimpleIdentifier).name, 'f');
+ expect(functionExpressionInvocation.argumentList.arguments, isEmpty);
+ var typeArgs = functionExpressionInvocation.typeArguments!.arguments;
+ expect(typeArgs, hasLength(2));
+ expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
+ expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
+ listener.assertErrors([
+ expectedError(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 1, 6),
+ ]);
+ }
+
+ void test_followingToken_accepted_ampersand() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> & 0', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_asterisk() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> * 0', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_bar() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> | 0', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_caret() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> ^ 0', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_closeBrace() {
+ expect_f_a_b((parseExpression('{f<a, b>}', featureSet: constructorTearoffs)
+ as SetOrMapLiteral)
+ .elements[0]);
+ }
+
+ void test_followingToken_accepted_closeBracket() {
+ expect_f_a_b((parseExpression('[f<a, b>]', featureSet: constructorTearoffs)
+ as ListLiteral)
+ .elements[0]);
+ }
+
+ void test_followingToken_accepted_closeParen() {
+ expect_f_a_b((parseExpression('g(f<a, b>)', featureSet: constructorTearoffs)
+ as MethodInvocation)
+ .argumentList
+ .arguments[0]);
+ }
+
+ void test_followingToken_accepted_colon() {
+ expect_f_a_b(
+ ((parseExpression('{f<a, b>: null}', featureSet: constructorTearoffs)
+ as SetOrMapLiteral)
+ .elements[0] as MapLiteralEntry)
+ .key);
+ }
+
+ void test_followingToken_accepted_comma() {
+ expect_f_a_b(
+ (parseExpression('[f<a, b>, null]', featureSet: constructorTearoffs)
+ as ListLiteral)
+ .elements[0]);
+ }
+
+ void test_followingToken_accepted_equals() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> == null', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_not_equals() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> != null', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_openParen() {
+ // This is a special case because when a `(` follows `<typeArguments>` it is
+ // parsed as a MethodInvocation rather than a GenericInstantiation.
+ var methodInvocation =
+ parseExpression('f<a, b>()', featureSet: constructorTearoffs)
+ as MethodInvocation;
+ expect(methodInvocation.methodName.name, 'f');
+ var typeArgs = methodInvocation.typeArguments!.arguments;
+ expect(typeArgs, hasLength(2));
+ expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
+ expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
+ expect(methodInvocation.argumentList.arguments, isEmpty);
+ }
+
+ void test_followingToken_accepted_percent() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> % 0', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_period_methodInvocation() {
+ // This is a special case because `f<a, b>.methodName(...)` is parsed as an
+ // InstanceCreationExpression.
+ var instanceCreationExpression =
+ parseExpression('f<a, b>.toString()', featureSet: constructorTearoffs)
+ as InstanceCreationExpression;
+ var constructorName = instanceCreationExpression.constructorName;
+ var type = constructorName.type;
+ expect((type.name as SimpleIdentifier).name, 'f');
+ var typeArgs = type.typeArguments!.arguments;
+ expect(typeArgs, hasLength(2));
+ expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
+ expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
+ expect(constructorName.name!.name, 'toString');
+ expect(instanceCreationExpression.argumentList.arguments, isEmpty);
+ }
+
+ void test_followingToken_accepted_period_methodInvocation_generic() {
+ expect_f_a_b(
+ (parseExpression('f<a, b>.foo<c>()', featureSet: constructorTearoffs)
+ as MethodInvocation)
+ .target!);
+ }
+
+ void test_followingToken_accepted_period_period() {
+ expect_f_a_b(
+ (parseExpression('f<a, b>..toString()', featureSet: constructorTearoffs)
+ as CascadeExpression)
+ .target);
+ }
+
+ void test_followingToken_accepted_period_propertyAccess() {
+ expect_f_a_b(
+ (parseExpression('f<a, b>.hashCode', featureSet: constructorTearoffs)
+ as PropertyAccess)
+ .target!);
+ }
+
+ void test_followingToken_accepted_plus() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> + 0', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_question() {
+ expect_f_a_b((parseExpression('f<a, b> ? null : null',
+ featureSet: constructorTearoffs) as ConditionalExpression)
+ .condition);
+ }
+
+ void test_followingToken_accepted_question_period_methodInvocation() {
+ expect_f_a_b(
+ (parseExpression('f<a, b>?.toString()', featureSet: constructorTearoffs)
+ as MethodInvocation)
+ .target!);
+ }
+
+ void test_followingToken_accepted_question_period_methodInvocation_generic() {
+ expect_f_a_b(
+ (parseExpression('f<a, b>?.foo<c>()', featureSet: constructorTearoffs)
+ as MethodInvocation)
+ .target!);
+ }
+
+ void test_followingToken_accepted_question_period_period() {
+ expect_f_a_b((parseExpression('f<a, b>?..toString()',
+ featureSet: constructorTearoffs) as CascadeExpression)
+ .target);
+ }
+
+ void test_followingToken_accepted_question_period_propertyAccess() {
+ expect_f_a_b(
+ (parseExpression('f<a, b>?.hashCode', featureSet: constructorTearoffs)
+ as PropertyAccess)
+ .target!);
+ }
+
+ void test_followingToken_accepted_question_question() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> ?? 0', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_semicolon() {
+ expect_f_a_b((parseStatement('f<a, b>;', featureSet: constructorTearoffs)
+ as ExpressionStatement)
+ .expression);
+ listener.assertNoErrors();
+ }
+
+ void test_followingToken_accepted_slash() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> / 1', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_accepted_tilde_slash() {
+ expect_f_a_b(
+ (parseExpression('f<a, b> ~/ 1', featureSet: constructorTearoffs)
+ as BinaryExpression)
+ .leftOperand);
+ }
+
+ void test_followingToken_rejected_bang_openBracket() {
+ expect_two_args(
+ parseExpression('f(a<b,c>![d])', featureSet: constructorTearoffs)
+ as MethodInvocation);
+ }
+
+ void test_followingToken_rejected_bang_paren() {
+ expect_two_args(
+ parseExpression('f(a<b,c>!(d))', featureSet: constructorTearoffs)
+ as MethodInvocation);
+ }
+
+ void test_followingToken_rejected_lessThan() {
+ // Note: in principle we could parse this as a generic instantiation of a
+ // generic instantiation, but such an expression would be meaningless so we
+ // reject it at the parser level.
+ parseExpression('f<a><b>', featureSet: constructorTearoffs, errors: [
+ expectedError(ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, 3, 1),
+ expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 0),
+ ]);
+ }
+
+ void test_followingToken_rejected_minus() {
+ expect_two_args(
+ parseExpression('f(a<b,c>-d)', featureSet: constructorTearoffs)
+ as MethodInvocation);
+ }
+
+ void test_followingToken_rejected_openBracket() {
+ expect_two_args(
+ parseExpression('f(a<b,c>[d])', featureSet: constructorTearoffs)
+ as MethodInvocation);
+ }
+
+ void test_followingToken_rejected_openBracket_error() {
+ // Note that theoretically this could be successfully parsed by interpreting
+ // `<` and `>` as delimiting type arguments, but the parser doesn't have
+ // enough lookahead to see that this is the only possible error-free parse;
+ // it commits to interpreting `<` and `>` as operators when it sees the `[`.
+ expect_two_args(parseExpression('f(a<b,c>[d]>e)',
+ featureSet: constructorTearoffs,
+ errors: [
+ expectedError(
+ ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, 11, 1),
+ ]) as MethodInvocation);
+ }
+
+ void test_followingToken_rejected_openBracket_unambiguous() {
+ expect_two_args(
+ parseExpression('f(a<b,c>[d, e])', featureSet: constructorTearoffs)
+ as MethodInvocation);
+ }
+
+ void test_methodTearoff() {
+ var functionReference =
+ parseExpression('f().m<a, b>', featureSet: constructorTearoffs)
+ as FunctionReference;
+ var function = functionReference.function as PropertyAccess;
+ var target = function.target as MethodInvocation;
+ expect(target.methodName.name, 'f');
+ expect(function.propertyName.name, 'm');
+ var typeArgs = functionReference.typeArguments!.arguments;
+ expect(typeArgs, hasLength(2));
+ expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
+ expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
+ }
+
+ void test_prefixedIdentifier() {
+ var functionReference =
+ parseExpression('prefix.f<a, b>', featureSet: constructorTearoffs)
+ as FunctionReference;
+ var function = functionReference.function as PrefixedIdentifier;
+ expect(function.prefix.name, 'prefix');
+ expect(function.identifier.name, 'f');
+ var typeArgs = functionReference.typeArguments!.arguments;
+ expect(typeArgs, hasLength(2));
+ expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
+ expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
+ }
+
+ void test_three_identifiers() {
+ var functionReference = parseExpression('prefix.ClassName.m<a, b>',
+ featureSet: constructorTearoffs) as FunctionReference;
+ var function = functionReference.function as PropertyAccess;
+ var target = function.target as PrefixedIdentifier;
+ expect(target.prefix.name, 'prefix');
+ expect(target.identifier.name, 'ClassName');
+ expect(function.propertyName.name, 'm');
+ var typeArgs = functionReference.typeArguments!.arguments;
+ expect(typeArgs, hasLength(2));
+ expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
+ expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
+ }
+}
diff --git a/pkg/analyzer/test/generated/parser_test_base.dart b/pkg/analyzer/test/generated/parser_test_base.dart
index 17c0c9f..7498a95 100644
--- a/pkg/analyzer/test/generated/parser_test_base.dart
+++ b/pkg/analyzer/test/generated/parser_test_base.dart
@@ -220,12 +220,18 @@
implements AbstractParserTestCase {
static final List<ErrorCode> NO_ERROR_COMPARISON = <ErrorCode>[];
+ final constructorTearoffs = FeatureSet.forTesting(
+ sdkVersion: '2.14.0', additionalFeatures: [Feature.constructor_tearoffs]);
+
final controlFlow = FeatureSet.latestLanguageVersion();
final spread = FeatureSet.latestLanguageVersion();
final nonNullable = FeatureSet.latestLanguageVersion();
+ final preConstructorTearoffs = FeatureSet.fromEnableFlags2(
+ sdkLanguageVersion: Version.parse('2.13.0'), flags: []);
+
final preNonNullable = FeatureSet.fromEnableFlags2(
sdkLanguageVersion: Version.parse('2.9.0'),
flags: [],
diff --git a/pkg/analyzer/test/generated/simple_parser_test.dart b/pkg/analyzer/test/generated/simple_parser_test.dart
index 5bdc51f..3a2881c 100644
--- a/pkg/analyzer/test/generated/simple_parser_test.dart
+++ b/pkg/analyzer/test/generated/simple_parser_test.dart
@@ -1419,15 +1419,14 @@
expect(unit, isNotNull);
var f = unit.declarations[0] as FunctionDeclaration;
var body = f.functionExpression.body as ExpressionFunctionBody;
- expect(body.expression, isInstanceCreationExpression);
- var creation = body.expression as InstanceCreationExpressionImpl;
- expect(creation.keyword, isNull);
- ConstructorName constructorName = creation.constructorName;
- expect(constructorName.type.toSource(), 'C<E>');
- expect(constructorName.period, isNotNull);
- expect(constructorName.name, isNotNull);
- expect(creation.argumentList, isNotNull);
- expect(creation.typeArguments!.arguments, hasLength(1));
+ expect(body.expression, isMethodInvocation);
+ var methodInvocation = body.expression as MethodInvocationImpl;
+ var target = methodInvocation.target!;
+ expect(target, isFunctionExpressionInvocation);
+ expect(target.toSource(), 'C<E>()');
+ expect(methodInvocation.methodName.name, 'n');
+ expect(methodInvocation.argumentList, isNotNull);
+ expect(methodInvocation.typeArguments!.arguments, hasLength(1));
}
void test_parseInstanceCreation_noKeyword_prefix() {
diff --git a/pkg/analyzer/test/generated/test_all.dart b/pkg/analyzer/test/generated/test_all.dart
index 197c167..efc1a0e 100644
--- a/pkg/analyzer/test/generated/test_all.dart
+++ b/pkg/analyzer/test/generated/test_all.dart
@@ -16,6 +16,7 @@
import 'expression_parser_test.dart' as expression_parser;
import 'extension_methods_parser_test.dart' as extension_methods_parser;
import 'formal_parameter_parser_test.dart' as formal_parameter_parser;
+import 'function_reference_parser_test.dart' as function_reference_parser;
import 'generic_metadata_parser_test.dart' as generic_metadata_parser;
import 'invalid_code_test.dart' as invalid_code;
import 'issues_test.dart' as issues;
@@ -56,6 +57,7 @@
expression_parser.main();
extension_methods_parser.main();
formal_parameter_parser.main();
+ function_reference_parser.main();
generic_metadata_parser.main();
invalid_code.main();
issues.main();
diff --git a/pkg/analyzer/test/src/diagnostics/experiment_not_enabled_test.dart b/pkg/analyzer/test/src/diagnostics/experiment_not_enabled_test.dart
index 07eeb68..e1037ea 100644
--- a/pkg/analyzer/test/src/diagnostics/experiment_not_enabled_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/experiment_not_enabled_test.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
+import 'package:analyzer/src/error/codes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../dart/resolution/context_collection_resolution.dart';
@@ -15,6 +16,43 @@
@reflectiveTest
class ExperimentNotEnabledTest extends PubPackageResolutionTest {
+ test_constructor_tearoffs_disabled_grammar() async {
+ await assertErrorsInCode('''
+class Foo<X> {
+ const Foo.bar();
+ int get baz => 0;
+}
+main() {
+ Foo<int>.bar.baz();
+}
+''', [
+ // TODO(paulberry): the INVOCATION_OF_NON_FUNCTION_EXPRESSION error is
+ // bogus, and should go away once we implement visitor and resolution
+ // support for constructor tearoffs.
+ error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 67, 3),
+ error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 70, 5),
+ ]);
+ }
+
+ test_constructor_tearoffs_disabled_grammar_pre_nnbd() async {
+ await assertErrorsInCode('''
+// @dart=2.9
+class Foo<X> {
+ const Foo.bar();
+ int get baz => 0;
+}
+main() {
+ Foo<int>.bar.baz();
+}
+''', [
+ // TODO(paulberry): the INVOCATION_OF_NON_FUNCTION_EXPRESSION error is
+ // bogus, and should go away once we implement visitor and resolution
+ // support for constructor tearoffs.
+ error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 80, 3),
+ error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 83, 5),
+ ]);
+ }
+
test_nonFunctionTypeAliases_disabled() async {
await assertErrorsInCode(r'''
// @dart = 2.12
diff --git a/pkg/analyzer/test/src/diagnostics/inference_failure_on_instance_creation_test.dart b/pkg/analyzer/test/src/diagnostics/inference_failure_on_instance_creation_test.dart
index 69e9b22..02397d2 100644
--- a/pkg/analyzer/test/src/diagnostics/inference_failure_on_instance_creation_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/inference_failure_on_instance_creation_test.dart
@@ -2,7 +2,6 @@
// 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:analyzer/src/dart/analysis/experiments.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -22,7 +21,6 @@
super.setUp();
writeTestPackageAnalysisOptionsFile(
AnalysisOptionsFileConfig(
- experiments: [EnableString.nonfunction_type_aliases],
strictInference: true,
),
);
@@ -40,6 +38,18 @@
expect(result.errors[0].message, contains("'HashMap.from'"));
}
+ test_constructorNames_named_importPrefix() async {
+ await assertErrorsInCode('''
+import 'dart:collection' as c;
+void f() {
+ c.HashMap.from({1: 1, 2: 2, 3: 3});
+}
+''', [
+ error(HintCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 44, 14),
+ ]);
+ expect(result.errors[0].message, contains("'c.HashMap.from'"));
+ }
+
test_constructorNames_unnamed() async {
await assertErrorsInCode('''
import 'dart:collection';
@@ -52,6 +62,18 @@
expect(result.errors[0].message, contains("'HashMap'"));
}
+ test_constructorNames_unnamed_importPrefix() async {
+ await assertErrorsInCode('''
+import 'dart:collection' as c;
+void f() {
+ c.HashMap();
+}
+''', [
+ error(HintCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 44, 9),
+ ]);
+ expect(result.errors[0].message, contains("'c.HashMap'"));
+ }
+
test_explicitTypeArgument() async {
await assertNoErrorsInCode(r'''
import 'dart:collection';
@@ -61,6 +83,54 @@
''');
}
+ test_genericMetadata_missingTypeArg() async {
+ await assertErrorsInCode(r'''
+class C<T> {
+ const C();
+}
+
+@C()
+void f() {}
+''', [
+ error(HintCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 29, 4),
+ ]);
+ }
+
+ test_genericMetadata_missingTypeArg_withoutGenericMetadata() async {
+ writeTestPackageConfig(PackageConfigFileBuilder(), languageVersion: '2.12');
+ await assertNoErrorsInCode(r'''
+class C<T> {
+ const C();
+}
+
+@C()
+void f() {}
+''');
+ }
+
+ test_genericMetadata_upwardsInference() async {
+ await assertNoErrorsInCode(r'''
+class C<T> {
+ final T f;
+ const C(this.f);
+}
+
+@C(7)
+void g() {}
+''');
+ }
+
+ test_genericMetadata_withTypeArg() async {
+ await assertNoErrorsInCode(r'''
+class C<T> {
+ const C();
+}
+
+@C<int>()
+void f() {}
+''');
+ }
+
test_missingTypeArgument_downwardInference() async {
await assertNoErrorsInCode(r'''
import 'dart:collection';
diff --git a/pkg/analyzer/test/src/summary/resynthesize_ast2_test.dart b/pkg/analyzer/test/src/summary/resynthesize_ast2_test.dart
index b07b6f8..57f9f33 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_ast2_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_ast2_test.dart
@@ -59,7 +59,10 @@
var inputUnits = <LinkInputUnit>[];
_addLibraryUnits(source, unit, inputUnits, featureSet);
inputLibraries.add(
- LinkInputLibrary(source, inputUnits),
+ LinkInputLibrary.tmp1(
+ source: source,
+ units: inputUnits,
+ ),
);
}
@@ -95,9 +98,7 @@
for (var inputLibrary in inputLibraries) {
for (var inputUnit in inputLibrary.units) {
var informativeBytes = writeUnitInformative(inputUnit.unit);
- // TODO(scheglov) store Uri, don't parse
- var uri = Uri.parse(inputUnit.uriStr);
- unitsInformativeBytes[uri] = informativeBytes;
+ unitsInformativeBytes[inputUnit.uri] = informativeBytes;
}
}
@@ -146,10 +147,18 @@
FeatureSet featureSet,
) {
units.add(
- LinkInputUnit(null, definingSource, false, definingUnit),
+ LinkInputUnit.tmp1(
+ partDirectiveIndex: null,
+ source: definingSource,
+ isSynthetic: false,
+ unit: definingUnit,
+ ),
);
+
+ var partDirectiveIndex = -1;
for (var directive in definingUnit.directives) {
if (directive is PartDirective) {
+ ++partDirectiveIndex;
var relativeUriStr = directive.uri.stringValue;
var partSource = sourceFactory.resolveUri(
@@ -161,7 +170,13 @@
var text = _readSafely(partSource.fullName);
var unit = parseText(text, featureSet);
units.add(
- LinkInputUnit(relativeUriStr, partSource, false, unit),
+ LinkInputUnit.tmp1(
+ partDirectiveIndex: partDirectiveIndex,
+ partUriStr: relativeUriStr,
+ source: partSource,
+ isSynthetic: false,
+ unit: unit,
+ ),
);
}
}
@@ -185,7 +200,10 @@
var units = <LinkInputUnit>[];
_addLibraryUnits(source, unit, units, featureSet);
libraries.add(
- LinkInputLibrary(source, units),
+ LinkInputLibrary.tmp1(
+ source: source,
+ units: units,
+ ),
);
void addRelativeUriStr(StringLiteral uriNode) {
diff --git a/pkg/analyzer/test/util/ast_type_matchers.dart b/pkg/analyzer/test/util/ast_type_matchers.dart
index c56bb8d..71a811d 100644
--- a/pkg/analyzer/test/util/ast_type_matchers.dart
+++ b/pkg/analyzer/test/util/ast_type_matchers.dart
@@ -128,6 +128,8 @@
const isFunctionExpressionInvocation =
TypeMatcher<FunctionExpressionInvocation>();
+const isFunctionReference = TypeMatcher<FunctionReference>();
+
const isFunctionTypeAlias = TypeMatcher<FunctionTypeAlias>();
const isFunctionTypedFormalParameter =
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 2164ae6..99bf9ab 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -75,7 +75,13 @@
import '../fasta_codes.dart' as fasta;
-import '../fasta_codes.dart' show LocatedMessage, Message, noLength, Template;
+import '../fasta_codes.dart'
+ show
+ LocatedMessage,
+ Message,
+ Template,
+ noLength,
+ templateExperimentNotEnabled;
import '../identifiers.dart'
show Identifier, InitializedIdentifier, QualifiedName, flattenName;
@@ -6295,6 +6301,18 @@
}
@override
+ void handleTypeArgumentApplication(Token openAngleBracket) {
+ /// TODO(johnniwinther, paulberry): add support for this construct when the
+ /// "constructor-tearoffs" feature is enabled.
+ pop(); // typeArguments
+ addProblem(
+ templateExperimentNotEnabled.withArguments('constructor-tearoffs',
+ libraryBuilder.enableConstructorTearoffsVersionInLibrary.toText()),
+ openAngleBracket.charOffset,
+ noLength);
+ }
+
+ @override
UnresolvedType validateTypeUse(UnresolvedType unresolved,
{bool nonInstanceAccessIsError, bool allowPotentiallyConstantType}) {
assert(nonInstanceAccessIsError != null);
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index 0064a64..b09820a 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -313,6 +313,7 @@
bool _enableNonfunctionTypeAliasesInLibrary;
bool _enableNonNullableInLibrary;
Version _enableNonNullableVersionInLibrary;
+ Version _enableConstructorTearoffsVersionInLibrary;
bool _enableTripleShiftInLibrary;
bool _enableExtensionMethodsInLibrary;
bool _enableGenericMetadataInLibrary;
@@ -350,6 +351,11 @@
.getExperimentEnabledVersionInLibrary(
ExperimentalFlag.nonNullable, _packageUri ?? importUri);
+ Version get enableConstructorTearoffsVersionInLibrary =>
+ _enableConstructorTearoffsVersionInLibrary ??= loader.target
+ .getExperimentEnabledVersionInLibrary(
+ ExperimentalFlag.constructorTearoffs, _packageUri ?? importUri);
+
bool get enableTripleShiftInLibrary => _enableTripleShiftInLibrary ??=
loader.target.isExperimentEnabledInLibraryByVersion(
ExperimentalFlag.tripleShift,
diff --git a/pkg/front_end/lib/src/fasta/util/direct_parser_ast_helper.dart b/pkg/front_end/lib/src/fasta/util/direct_parser_ast_helper.dart
index 7ea0645..5c14977 100644
--- a/pkg/front_end/lib/src/fasta/util/direct_parser_ast_helper.dart
+++ b/pkg/front_end/lib/src/fasta/util/direct_parser_ast_helper.dart
@@ -2542,6 +2542,14 @@
DirectParserASTType.HANDLE);
seen(data);
}
+
+ void handleTypeArgumentApplication(Token openAngleBracket) {
+ DirectParserASTContentTypeArgumentApplicationHandle data =
+ new DirectParserASTContentTypeArgumentApplicationHandle(
+ DirectParserASTType.HANDLE,
+ openAngleBracket: openAngleBracket);
+ seen(data);
+ }
}
class DirectParserASTContentArgumentsBegin extends DirectParserASTContent {
@@ -6861,3 +6869,16 @@
Map<String, Object?> get deprecatedArguments => {};
}
+
+class DirectParserASTContentTypeArgumentApplicationHandle
+ extends DirectParserASTContent {
+ final Token openAngleBracket;
+
+ DirectParserASTContentTypeArgumentApplicationHandle(DirectParserASTType type,
+ {required this.openAngleBracket})
+ : super("TypeArgumentApplication", type);
+
+ Map<String, Object?> get deprecatedArguments => {
+ "openAngleBracket": openAngleBracket,
+ };
+}
diff --git a/pkg/front_end/parser_testcases/general/function_reference_following_token.dart b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart
new file mode 100644
index 0000000..d426546
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart
@@ -0,0 +1,91 @@
+// Copyright (c) 2021, 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.md file.
+
+// The test cases called `typeArgs_...` verify that `<` and `>` are treated as
+// delimiting type arguments when the `>` is followed by one of the tokens:
+//
+// ( ) ] } : ; , . ? == != .. ?. ?? ?..
+// & | ^ + * % / ~/
+//
+// Unless otherwise noted, these test cases should not result in a parse error,
+// because they can be made into valid expressions through user-defined
+// operators.
+
+var typeArgs_ampersand = f<a, b> & 0;
+var typeArgs_asterisk = f<a, b> * 0;
+var typeArgs_bar = f<a, b> | 0;
+var typeArgs_caret = f<a, b> ^ 0;
+var typeArgs_closeBrace = {f<a, b>};
+var typeArgs_closeBracket = [f<a, b>];
+var typeArgs_closeParen = g(f<a, b>);
+var typeArgs_colon = {f<a, b>: null};
+var typeArgs_comma = [f<a, b>, null];
+var typeArgs_equals = f<a, b> == null;
+var typeArgs_not_equals = f<a, b> != null;
+
+// This is a special case because when a `(` follows `<typeArguments>` it is
+// parsed as a MethodInvocation rather than a GenericInstantiation.
+var typeArgs_openParen = f<a, b>();
+
+var typeArgs_percent = f<a, b> % 0;
+
+// This is a special case because `f<a, b>.methodName(...)` is parsed as an
+// InstanceCreationExpression.
+var typeArgs_period_methodInvocation = f<a, b>.toString();
+
+var typeArgs_period_methodInvocation_generic = f<a, b>.foo<c>();
+var typeArgs_period_period = f<a, b>..toString();
+var typeArgs_period_propertyAccess = f<a, b>.hashCode;
+var typeArgs_plus = f<a, b> + 0;
+
+// Note: this could never be a valid expression because the thing to the left of
+// `?` is required to have type `bool`, and `f<a, b>` can only have type `Type`
+// or a function type. But it is not the responsibility of the parser to report
+// an error here; that should be done by type analysis.
+var typeArgs_question = f<a, b> ? null : null;
+
+var typeArgs_question_period_methodInvocation = f<a, b>?.toString();
+var typeArgs_question_period_methodInvocation_generic = f<a, b>?.foo<c>();
+var typeArgs_question_period_period = f<a, b>?..toString();
+var typeArgs_question_period_propertyAccess = f<a, b>?.hashCode;
+var typeArgs_question_question = f<a, b> ?? 0;
+var typeArgs_semicolon = f<a, b>;
+var typeArgs_slash = f<a, b> / 1;
+var typeArgs_tilde_slash = f<a, b> ~/ 1;
+
+// The test cases called `operators_...` verify that `<` and `>` are treated as
+// operators when the `>` is not followed by one of the tokens:
+//
+// ( ) ] } : ; , . ? == != .. ?. ?? ?..
+// & | ^ + * % / ~/
+//
+// Unless otherwise noted, these test cases should not result in a parse error,
+// because they can be made into valid expressions through user-defined
+// operators.
+
+// Note: this could never be a valid expression because the thing to the right
+// of `!` is required to have type `bool`, and the type of `[d]` will always be
+// a list type. But it is not the responsibility of the parser to report an
+// error here; that should be done by type analysis.
+var operators_bang_openBracket = f(a<b,c>![d]);
+
+var operators_bang_paren = f(a<b,c>!(d));
+
+// Note: in principle we could parse this as a generic instantiation of a
+// generic instantiation, but since `<` is not one of the tokens that signals
+// `<` and `>` to be treated as type argument delimiters, the first pair of `<`
+// and `>` is treated as operators, and this results in a parse error.
+var operators_lessThan = f<a><b>;
+
+var operators_minus = f(a<b,c>-d);
+var operators_openBracket = f(a<b,c>[d]);
+
+// Note: in principle we could parse `<b, c>` as type arguments, `[d]` as an
+// index operation, and the final `>` as a greater-than operator, but since `[`
+// is not one of the tokens that signals `<` and `>` to be treated as argument
+// delimiters, the pair of `<` and `>` is treated as operators, and this results
+// in a parse error.
+var operators_openBracket_error = f(a<b,c>[d]>e);
+
+var operators_openBracket_unambiguous = f(a<b,c>[d, e]);
diff --git a/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.expect b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.expect
new file mode 100644
index 0000000..1acd3c2
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.expect
@@ -0,0 +1,1008 @@
+Problems reported:
+
+parser/general/function_reference_following_token:79:29: A comparison expression can't be an operand of another comparison expression.
+var operators_lessThan = f<a><b>;
+ ^
+
+parser/general/function_reference_following_token:79:33: Expected '[' before this.
+var operators_lessThan = f<a><b>;
+ ^
+
+parser/general/function_reference_following_token:89:46: A comparison expression can't be an operand of another comparison expression.
+var operators_openBracket_error = f(a<b,c>[d]>e);
+ ^
+
+beginCompilationUnit(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields()
+ handleNoType(var)
+ handleIdentifier(typeArgs_ampersand, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(&)
+ handleLiteralInt(0)
+ endBinaryExpression(&)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_asterisk, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(*)
+ handleLiteralInt(0)
+ endBinaryExpression(*)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_bar, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(|)
+ handleLiteralInt(0)
+ endBinaryExpression(|)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_caret, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(^)
+ handleLiteralInt(0)
+ endBinaryExpression(^)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_closeBrace, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleNoTypeArguments({)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ handleLiteralSetOrMap(1, {, null, }, true)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_closeBracket, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleNoTypeArguments([)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ handleLiteralList(1, [, null, ])
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_closeParen, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(g, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ endArguments(1, (, ))
+ handleSend(g, ;)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_colon, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleNoTypeArguments({)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ handleLiteralNull(null)
+ handleLiteralMapEntry(:, })
+ handleLiteralSetOrMap(1, {, null, }, false)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_comma, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleNoTypeArguments([)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ handleLiteralNull(null)
+ handleLiteralList(2, [, null, ])
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_equals, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(==)
+ handleLiteralNull(null)
+ endBinaryExpression(==)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_not_equals, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(!=)
+ handleLiteralNull(null)
+ endBinaryExpression(!=)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_openParen, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ beginArguments(()
+ endArguments(0, (, ))
+ handleSend(f, ;)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_percent, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(%)
+ handleLiteralInt(0)
+ endBinaryExpression(%)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_period_methodInvocation, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ beginImplicitCreationExpression(=)
+ handleIdentifier(f, constructorReference)
+ beginConstructorReference(f)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleIdentifier(toString, constructorReferenceContinuationAfterTypeArguments)
+ endConstructorReference(f, ., ()
+ beginArguments(()
+ endArguments(0, (, ))
+ endImplicitCreationExpression(=)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_period_methodInvocation_generic, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ handleIdentifier(foo, expressionContinuation)
+ beginTypeArguments(<)
+ handleIdentifier(c, typeReference)
+ handleNoTypeArguments(>)
+ handleType(c, null)
+ endTypeArguments(1, <, >)
+ beginArguments(()
+ endArguments(0, (, ))
+ handleSend(foo, ;)
+ handleEndingBinaryExpression(.)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_period_period, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginCascade(..)
+ handleIdentifier(toString, expressionContinuation)
+ handleNoTypeArguments(()
+ beginArguments(()
+ endArguments(0, (, ))
+ handleSend(toString, ;)
+ handleEndingBinaryExpression(..)
+ endCascade()
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_period_propertyAccess, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ handleIdentifier(hashCode, expressionContinuation)
+ handleNoTypeArguments(;)
+ handleNoArguments(;)
+ handleSend(hashCode, ;)
+ handleEndingBinaryExpression(.)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_plus, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(+)
+ handleLiteralInt(0)
+ endBinaryExpression(+)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_question, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginConditionalExpression(?)
+ handleLiteralNull(null)
+ handleConditionalExpressionColon()
+ handleLiteralNull(null)
+ endConditionalExpression(?, :)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_question_period_methodInvocation, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ handleIdentifier(toString, expressionContinuation)
+ handleNoTypeArguments(()
+ beginArguments(()
+ endArguments(0, (, ))
+ handleSend(toString, ;)
+ handleEndingBinaryExpression(?.)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_question_period_methodInvocation_generic, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ handleIdentifier(foo, expressionContinuation)
+ beginTypeArguments(<)
+ handleIdentifier(c, typeReference)
+ handleNoTypeArguments(>)
+ handleType(c, null)
+ endTypeArguments(1, <, >)
+ beginArguments(()
+ endArguments(0, (, ))
+ handleSend(foo, ;)
+ handleEndingBinaryExpression(?.)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_question_period_period, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginCascade(?..)
+ handleIdentifier(toString, expressionContinuation)
+ handleNoTypeArguments(()
+ beginArguments(()
+ endArguments(0, (, ))
+ handleSend(toString, ;)
+ handleEndingBinaryExpression(?..)
+ endCascade()
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_question_period_propertyAccess, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ handleIdentifier(hashCode, expressionContinuation)
+ handleNoTypeArguments(;)
+ handleNoArguments(;)
+ handleSend(hashCode, ;)
+ handleEndingBinaryExpression(?.)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_question_question, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(??)
+ handleLiteralInt(0)
+ endBinaryExpression(??)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_semicolon, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_slash, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(/)
+ handleLiteralInt(1)
+ endBinaryExpression(/)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(typeArgs_tilde_slash, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ beginBinaryExpression(~/)
+ handleLiteralInt(1)
+ endBinaryExpression(~/)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(operators_bang_openBracket, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(a, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(a, <)
+ beginBinaryExpression(<)
+ handleIdentifier(b, expression)
+ handleNoTypeArguments(,)
+ handleNoArguments(,)
+ handleSend(b, ,)
+ endBinaryExpression(<)
+ handleIdentifier(c, expression)
+ handleNoTypeArguments(>)
+ handleNoArguments(>)
+ handleSend(c, >)
+ beginBinaryExpression(>)
+ handleNoTypeArguments([)
+ handleIdentifier(d, expression)
+ handleNoTypeArguments(])
+ handleNoArguments(])
+ handleSend(d, ])
+ handleLiteralList(1, [, null, ])
+ handleUnaryPrefixExpression(!)
+ endBinaryExpression(>)
+ endArguments(2, (, ))
+ handleSend(f, ;)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(operators_bang_paren, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(a, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(a, <)
+ beginBinaryExpression(<)
+ handleIdentifier(b, expression)
+ handleNoTypeArguments(,)
+ handleNoArguments(,)
+ handleSend(b, ,)
+ endBinaryExpression(<)
+ handleIdentifier(c, expression)
+ handleNoTypeArguments(>)
+ handleNoArguments(>)
+ handleSend(c, >)
+ beginBinaryExpression(>)
+ handleIdentifier(d, expression)
+ handleNoTypeArguments())
+ handleNoArguments())
+ handleSend(d, ))
+ handleParenthesizedExpression(()
+ handleUnaryPrefixExpression(!)
+ endBinaryExpression(>)
+ endArguments(2, (, ))
+ handleSend(f, ;)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(operators_lessThan, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginBinaryExpression(<)
+ handleIdentifier(a, expression)
+ handleNoTypeArguments(>)
+ handleNoArguments(>)
+ handleSend(a, >)
+ endBinaryExpression(<)
+ handleRecoverableError(EqualityCannotBeEqualityOperand, >, >)
+ beginBinaryExpression(>)
+ beginTypeArguments(<)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(1, <, >)
+ handleRecoverableError(Message[ExpectedButGot, Expected '[' before this., null, {string: [}], ;, ;)
+ handleLiteralList(0, [, null, ])
+ endBinaryExpression(>)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(operators_minus, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(a, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(a, <)
+ beginBinaryExpression(<)
+ handleIdentifier(b, expression)
+ handleNoTypeArguments(,)
+ handleNoArguments(,)
+ handleSend(b, ,)
+ endBinaryExpression(<)
+ handleIdentifier(c, expression)
+ handleNoTypeArguments(>)
+ handleNoArguments(>)
+ handleSend(c, >)
+ beginBinaryExpression(>)
+ handleIdentifier(d, expression)
+ handleNoTypeArguments())
+ handleNoArguments())
+ handleSend(d, ))
+ handleUnaryPrefixExpression(-)
+ endBinaryExpression(>)
+ endArguments(2, (, ))
+ handleSend(f, ;)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(operators_openBracket, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(a, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(a, <)
+ beginBinaryExpression(<)
+ handleIdentifier(b, expression)
+ handleNoTypeArguments(,)
+ handleNoArguments(,)
+ handleSend(b, ,)
+ endBinaryExpression(<)
+ handleIdentifier(c, expression)
+ handleNoTypeArguments(>)
+ handleNoArguments(>)
+ handleSend(c, >)
+ beginBinaryExpression(>)
+ handleNoTypeArguments([)
+ handleIdentifier(d, expression)
+ handleNoTypeArguments(])
+ handleNoArguments(])
+ handleSend(d, ])
+ handleLiteralList(1, [, null, ])
+ endBinaryExpression(>)
+ endArguments(2, (, ))
+ handleSend(f, ;)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(operators_openBracket_error, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(a, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(a, <)
+ beginBinaryExpression(<)
+ handleIdentifier(b, expression)
+ handleNoTypeArguments(,)
+ handleNoArguments(,)
+ handleSend(b, ,)
+ endBinaryExpression(<)
+ handleIdentifier(c, expression)
+ handleNoTypeArguments(>)
+ handleNoArguments(>)
+ handleSend(c, >)
+ beginBinaryExpression(>)
+ handleNoTypeArguments([)
+ handleIdentifier(d, expression)
+ handleNoTypeArguments(])
+ handleNoArguments(])
+ handleSend(d, ])
+ handleLiteralList(1, [, null, ])
+ endBinaryExpression(>)
+ handleRecoverableError(EqualityCannotBeEqualityOperand, >, >)
+ beginBinaryExpression(>)
+ handleIdentifier(e, expression)
+ handleNoTypeArguments())
+ handleNoArguments())
+ handleSend(e, ))
+ endBinaryExpression(>)
+ endArguments(2, (, ))
+ handleSend(f, ;)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(operators_openBracket_unambiguous, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(a, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(a, <)
+ beginBinaryExpression(<)
+ handleIdentifier(b, expression)
+ handleNoTypeArguments(,)
+ handleNoArguments(,)
+ handleSend(b, ,)
+ endBinaryExpression(<)
+ handleIdentifier(c, expression)
+ handleNoTypeArguments(>)
+ handleNoArguments(>)
+ handleSend(c, >)
+ beginBinaryExpression(>)
+ handleNoTypeArguments([)
+ handleIdentifier(d, expression)
+ handleNoTypeArguments(,)
+ handleNoArguments(,)
+ handleSend(d, ,)
+ handleIdentifier(e, expression)
+ handleNoTypeArguments(])
+ handleNoArguments(])
+ handleSend(e, ])
+ handleLiteralList(2, [, null, ])
+ endBinaryExpression(>)
+ endArguments(2, (, ))
+ handleSend(f, ;)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration()
+endCompilationUnit(34, )
diff --git a/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.intertwined.expect
new file mode 100644
index 0000000..c8fe425
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.intertwined.expect
@@ -0,0 +1,1959 @@
+parseUnit(var)
+ skipErrorTokens(var)
+ listener: beginCompilationUnit(var)
+ syntheticPreviousToken(var)
+ parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
+ parseMetadataStar()
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl()
+ listener: beginTopLevelMember(var)
+ parseFields(, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_ampersand, DeclarationKind.TopLevel, null, false)
+ listener: beginFields()
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_ampersand, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_ampersand, typeArgs_ampersand, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(&)
+ parsePrecedenceExpression(&, 12, true)
+ parseUnaryExpression(&, true)
+ parsePrimary(&, expression)
+ parseLiteralInt(&)
+ listener: handleLiteralInt(0)
+ listener: endBinaryExpression(&)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_asterisk, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_asterisk, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_asterisk, typeArgs_asterisk, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(*)
+ parsePrecedenceExpression(*, 15, true)
+ parseUnaryExpression(*, true)
+ parsePrimary(*, expression)
+ parseLiteralInt(*)
+ listener: handleLiteralInt(0)
+ listener: endBinaryExpression(*)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_bar, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_bar, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_bar, typeArgs_bar, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(|)
+ parsePrecedenceExpression(|, 10, true)
+ parseUnaryExpression(|, true)
+ parsePrimary(|, expression)
+ parseLiteralInt(|)
+ listener: handleLiteralInt(0)
+ listener: endBinaryExpression(|)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_caret, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_caret, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_caret, typeArgs_caret, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(^)
+ parsePrecedenceExpression(^, 11, true)
+ parseUnaryExpression(^, true)
+ parsePrimary(^, expression)
+ parseLiteralInt(^)
+ listener: handleLiteralInt(0)
+ listener: endBinaryExpression(^)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_closeBrace, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_closeBrace, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_closeBrace, typeArgs_closeBrace, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ listener: handleNoTypeArguments({)
+ parseLiteralSetOrMapSuffix(=, null)
+ parseExpression({)
+ parsePrecedenceExpression({, 1, true)
+ parseUnaryExpression({, true)
+ parsePrimary({, expression)
+ parseSendOrFunctionLiteral({, expression)
+ parseSend({, expression)
+ isNextIdentifier({)
+ ensureIdentifier({, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: handleLiteralSetOrMap(1, {, null, }, true)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_closeBracket, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_closeBracket, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_closeBracket, typeArgs_closeBracket, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ listener: handleNoTypeArguments([)
+ parseLiteralListSuffix(=, null)
+ parseExpression([)
+ parsePrecedenceExpression([, 1, true)
+ parseUnaryExpression([, true)
+ parsePrimary([, expression)
+ parseSendOrFunctionLiteral([, expression)
+ parseSend([, expression)
+ isNextIdentifier([)
+ ensureIdentifier([, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: handleLiteralList(1, [, null, ])
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_closeParen, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_closeParen, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_closeParen, typeArgs_closeParen, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ looksLikeFunctionBody(;)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(g, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(g)
+ parseArguments(g)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ isNextIdentifier(()
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: endArguments(1, (, ))
+ listener: handleSend(g, ;)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_colon, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_colon, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_colon, typeArgs_colon, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ listener: handleNoTypeArguments({)
+ parseLiteralSetOrMapSuffix(=, null)
+ parseExpression({)
+ parsePrecedenceExpression({, 1, true)
+ parseUnaryExpression({, true)
+ parsePrimary({, expression)
+ parseSendOrFunctionLiteral({, expression)
+ parseSend({, expression)
+ isNextIdentifier({)
+ ensureIdentifier({, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parseExpression(:)
+ parsePrecedenceExpression(:, 1, true)
+ parseUnaryExpression(:, true)
+ parsePrimary(:, expression)
+ parseLiteralNull(:)
+ listener: handleLiteralNull(null)
+ listener: handleLiteralMapEntry(:, })
+ listener: handleLiteralSetOrMap(1, {, null, }, false)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_comma, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_comma, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_comma, typeArgs_comma, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ listener: handleNoTypeArguments([)
+ parseLiteralListSuffix(=, null)
+ parseExpression([)
+ parsePrecedenceExpression([, 1, true)
+ parseUnaryExpression([, true)
+ parsePrimary([, expression)
+ parseSendOrFunctionLiteral([, expression)
+ parseSend([, expression)
+ isNextIdentifier([)
+ ensureIdentifier([, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parseExpression(,)
+ parsePrecedenceExpression(,, 1, true)
+ parseUnaryExpression(,, true)
+ parsePrimary(,, expression)
+ parseLiteralNull(,)
+ listener: handleLiteralNull(null)
+ listener: handleLiteralList(2, [, null, ])
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_equals, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_equals, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_equals, typeArgs_equals, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(==)
+ parsePrecedenceExpression(==, 8, true)
+ parseUnaryExpression(==, true)
+ parsePrimary(==, expression)
+ parseLiteralNull(==)
+ listener: handleLiteralNull(null)
+ listener: endBinaryExpression(==)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_not_equals, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_not_equals, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_not_equals, typeArgs_not_equals, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(!=)
+ parsePrecedenceExpression(!=, 8, true)
+ parseUnaryExpression(!=, true)
+ parsePrimary(!=, expression)
+ parseLiteralNull(!=)
+ listener: handleLiteralNull(null)
+ listener: endBinaryExpression(!=)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_openParen, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_openParen, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_openParen, typeArgs_openParen, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ looksLikeFunctionBody(;)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ parseArgumentsOpt(>)
+ parseArguments(>)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ listener: endArguments(0, (, ))
+ listener: handleSend(f, ;)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_percent, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_percent, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_percent, typeArgs_percent, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(%)
+ parsePrecedenceExpression(%, 15, true)
+ parseUnaryExpression(%, true)
+ parsePrimary(%, expression)
+ parseLiteralInt(%)
+ listener: handleLiteralInt(0)
+ listener: endBinaryExpression(%)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_period_methodInvocation, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_period_methodInvocation, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_period_methodInvocation, typeArgs_period_methodInvocation, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parseImplicitCreationExpression(=, Instance of 'ComplexTypeParamOrArgInfo')
+ listener: beginImplicitCreationExpression(=)
+ parseConstructorReference(=, Instance of 'ComplexTypeParamOrArgInfo')
+ ensureIdentifier(=, constructorReference)
+ listener: handleIdentifier(f, constructorReference)
+ listener: beginConstructorReference(f)
+ parseQualifiedRestOpt(f, constructorReferenceContinuation)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ ensureIdentifier(., constructorReferenceContinuationAfterTypeArguments)
+ listener: handleIdentifier(toString, constructorReferenceContinuationAfterTypeArguments)
+ listener: endConstructorReference(f, ., ()
+ parseConstructorInvocationArguments(toString)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ listener: endArguments(0, (, ))
+ listener: endImplicitCreationExpression(=)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_period_methodInvocation_generic, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_period_methodInvocation_generic, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_period_methodInvocation_generic, typeArgs_period_methodInvocation_generic, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parsePrimary(., expressionContinuation)
+ parseSendOrFunctionLiteral(., expressionContinuation)
+ looksLikeFunctionBody(;)
+ parseSend(., expressionContinuation)
+ isNextIdentifier(.)
+ ensureIdentifier(., expressionContinuation)
+ listener: handleIdentifier(foo, expressionContinuation)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(c, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(c, null)
+ listener: endTypeArguments(1, <, >)
+ parseArgumentsOpt(>)
+ parseArguments(>)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ listener: endArguments(0, (, ))
+ listener: handleSend(foo, ;)
+ listener: handleEndingBinaryExpression(.)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_period_period, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_period_period, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_period_period, typeArgs_period_period, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parseCascadeExpression(>)
+ listener: beginCascade(..)
+ parseSend(.., expressionContinuation)
+ isNextIdentifier(..)
+ ensureIdentifier(.., expressionContinuation)
+ listener: handleIdentifier(toString, expressionContinuation)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(toString)
+ parseArguments(toString)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ listener: endArguments(0, (, ))
+ listener: handleSend(toString, ;)
+ listener: handleEndingBinaryExpression(..)
+ parseArgumentOrIndexStar(), Instance of 'NoTypeParamOrArg', false)
+ listener: endCascade()
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_period_propertyAccess, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_period_propertyAccess, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_period_propertyAccess, typeArgs_period_propertyAccess, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parsePrimary(., expressionContinuation)
+ parseSendOrFunctionLiteral(., expressionContinuation)
+ parseSend(., expressionContinuation)
+ isNextIdentifier(.)
+ ensureIdentifier(., expressionContinuation)
+ listener: handleIdentifier(hashCode, expressionContinuation)
+ listener: handleNoTypeArguments(;)
+ parseArgumentsOpt(hashCode)
+ listener: handleNoArguments(;)
+ listener: handleSend(hashCode, ;)
+ listener: handleEndingBinaryExpression(.)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_plus, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_plus, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_plus, typeArgs_plus, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(+)
+ parsePrecedenceExpression(+, 14, true)
+ parseUnaryExpression(+, true)
+ parsePrimary(+, expression)
+ parseLiteralInt(+)
+ listener: handleLiteralInt(0)
+ listener: endBinaryExpression(+)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_question, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_question, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_question, typeArgs_question, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parseConditionalExpressionRest(>)
+ listener: beginConditionalExpression(?)
+ parseExpressionWithoutCascade(?)
+ parsePrecedenceExpression(?, 1, false)
+ parseUnaryExpression(?, false)
+ parsePrimary(?, expression)
+ parseLiteralNull(?)
+ listener: handleLiteralNull(null)
+ ensureColon(null)
+ listener: handleConditionalExpressionColon()
+ parseExpressionWithoutCascade(:)
+ parsePrecedenceExpression(:, 1, false)
+ parseUnaryExpression(:, false)
+ parsePrimary(:, expression)
+ parseLiteralNull(:)
+ listener: handleLiteralNull(null)
+ listener: endConditionalExpression(?, :)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_question_period_methodInvocation, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_question_period_methodInvocation, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_question_period_methodInvocation, typeArgs_question_period_methodInvocation, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parsePrimary(?., expressionContinuation)
+ parseSendOrFunctionLiteral(?., expressionContinuation)
+ looksLikeFunctionBody(;)
+ parseSend(?., expressionContinuation)
+ isNextIdentifier(?.)
+ ensureIdentifier(?., expressionContinuation)
+ listener: handleIdentifier(toString, expressionContinuation)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(toString)
+ parseArguments(toString)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ listener: endArguments(0, (, ))
+ listener: handleSend(toString, ;)
+ listener: handleEndingBinaryExpression(?.)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_question_period_methodInvocation_generic, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_question_period_methodInvocation_generic, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_question_period_methodInvocation_generic, typeArgs_question_period_methodInvocation_generic, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parsePrimary(?., expressionContinuation)
+ parseSendOrFunctionLiteral(?., expressionContinuation)
+ looksLikeFunctionBody(;)
+ parseSend(?., expressionContinuation)
+ isNextIdentifier(?.)
+ ensureIdentifier(?., expressionContinuation)
+ listener: handleIdentifier(foo, expressionContinuation)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(c, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(c, null)
+ listener: endTypeArguments(1, <, >)
+ parseArgumentsOpt(>)
+ parseArguments(>)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ listener: endArguments(0, (, ))
+ listener: handleSend(foo, ;)
+ listener: handleEndingBinaryExpression(?.)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_question_period_period, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_question_period_period, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_question_period_period, typeArgs_question_period_period, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parseCascadeExpression(>)
+ listener: beginCascade(?..)
+ parseSend(?.., expressionContinuation)
+ isNextIdentifier(?..)
+ ensureIdentifier(?.., expressionContinuation)
+ listener: handleIdentifier(toString, expressionContinuation)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(toString)
+ parseArguments(toString)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ listener: endArguments(0, (, ))
+ listener: handleSend(toString, ;)
+ listener: handleEndingBinaryExpression(?..)
+ parseArgumentOrIndexStar(), Instance of 'NoTypeParamOrArg', false)
+ listener: endCascade()
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_question_period_propertyAccess, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_question_period_propertyAccess, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_question_period_propertyAccess, typeArgs_question_period_propertyAccess, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ parsePrimary(?., expressionContinuation)
+ parseSendOrFunctionLiteral(?., expressionContinuation)
+ parseSend(?., expressionContinuation)
+ isNextIdentifier(?.)
+ ensureIdentifier(?., expressionContinuation)
+ listener: handleIdentifier(hashCode, expressionContinuation)
+ listener: handleNoTypeArguments(;)
+ parseArgumentsOpt(hashCode)
+ listener: handleNoArguments(;)
+ listener: handleSend(hashCode, ;)
+ listener: handleEndingBinaryExpression(?.)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_question_question, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_question_question, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_question_question, typeArgs_question_question, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(??)
+ parsePrecedenceExpression(??, 5, true)
+ parseUnaryExpression(??, true)
+ parsePrimary(??, expression)
+ parseLiteralInt(??)
+ listener: handleLiteralInt(0)
+ listener: endBinaryExpression(??)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_semicolon, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_semicolon, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_semicolon, typeArgs_semicolon, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_slash, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_slash, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_slash, typeArgs_slash, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(/)
+ parsePrecedenceExpression(/, 15, true)
+ parseUnaryExpression(/, true)
+ parsePrimary(/, expression)
+ parseLiteralInt(/)
+ listener: handleLiteralInt(1)
+ listener: endBinaryExpression(/)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', typeArgs_tilde_slash, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(typeArgs_tilde_slash, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(typeArgs_tilde_slash, typeArgs_tilde_slash, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: beginBinaryExpression(~/)
+ parsePrecedenceExpression(~/, 15, true)
+ parseUnaryExpression(~/, true)
+ parsePrimary(~/, expression)
+ parseLiteralInt(~/)
+ listener: handleLiteralInt(1)
+ listener: endBinaryExpression(~/)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', operators_bang_openBracket, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(operators_bang_openBracket, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(operators_bang_openBracket, operators_bang_openBracket, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ looksLikeFunctionBody(;)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(f)
+ parseArguments(f)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ isNextIdentifier(()
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(a, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(a)
+ listener: handleNoArguments(<)
+ listener: handleSend(a, <)
+ listener: beginBinaryExpression(<)
+ parsePrecedenceExpression(<, 9, true)
+ parseUnaryExpression(<, true)
+ parsePrimary(<, expression)
+ parseSendOrFunctionLiteral(<, expression)
+ parseSend(<, expression)
+ isNextIdentifier(<)
+ ensureIdentifier(<, expression)
+ listener: handleIdentifier(b, expression)
+ listener: handleNoTypeArguments(,)
+ parseArgumentsOpt(b)
+ listener: handleNoArguments(,)
+ listener: handleSend(b, ,)
+ listener: endBinaryExpression(<)
+ parseExpression(,)
+ parsePrecedenceExpression(,, 1, true)
+ parseUnaryExpression(,, true)
+ parsePrimary(,, expression)
+ parseSendOrFunctionLiteral(,, expression)
+ parseSend(,, expression)
+ isNextIdentifier(,)
+ ensureIdentifier(,, expression)
+ listener: handleIdentifier(c, expression)
+ listener: handleNoTypeArguments(>)
+ parseArgumentsOpt(c)
+ listener: handleNoArguments(>)
+ listener: handleSend(c, >)
+ listener: beginBinaryExpression(>)
+ parsePrecedenceExpression(>, 9, true)
+ parseUnaryExpression(>, true)
+ parsePrecedenceExpression(!, 16, true)
+ parseUnaryExpression(!, true)
+ parsePrimary(!, expression)
+ listener: handleNoTypeArguments([)
+ parseLiteralListSuffix(!, null)
+ parseExpression([)
+ parsePrecedenceExpression([, 1, true)
+ parseUnaryExpression([, true)
+ parsePrimary([, expression)
+ parseSendOrFunctionLiteral([, expression)
+ parseSend([, expression)
+ isNextIdentifier([)
+ ensureIdentifier([, expression)
+ listener: handleIdentifier(d, expression)
+ listener: handleNoTypeArguments(])
+ parseArgumentsOpt(d)
+ listener: handleNoArguments(])
+ listener: handleSend(d, ])
+ listener: handleLiteralList(1, [, null, ])
+ listener: handleUnaryPrefixExpression(!)
+ listener: endBinaryExpression(>)
+ listener: endArguments(2, (, ))
+ listener: handleSend(f, ;)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', operators_bang_paren, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(operators_bang_paren, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(operators_bang_paren, operators_bang_paren, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ looksLikeFunctionBody(;)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(f)
+ parseArguments(f)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ isNextIdentifier(()
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(a, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(a)
+ listener: handleNoArguments(<)
+ listener: handleSend(a, <)
+ listener: beginBinaryExpression(<)
+ parsePrecedenceExpression(<, 9, true)
+ parseUnaryExpression(<, true)
+ parsePrimary(<, expression)
+ parseSendOrFunctionLiteral(<, expression)
+ parseSend(<, expression)
+ isNextIdentifier(<)
+ ensureIdentifier(<, expression)
+ listener: handleIdentifier(b, expression)
+ listener: handleNoTypeArguments(,)
+ parseArgumentsOpt(b)
+ listener: handleNoArguments(,)
+ listener: handleSend(b, ,)
+ listener: endBinaryExpression(<)
+ parseExpression(,)
+ parsePrecedenceExpression(,, 1, true)
+ parseUnaryExpression(,, true)
+ parsePrimary(,, expression)
+ parseSendOrFunctionLiteral(,, expression)
+ parseSend(,, expression)
+ isNextIdentifier(,)
+ ensureIdentifier(,, expression)
+ listener: handleIdentifier(c, expression)
+ listener: handleNoTypeArguments(>)
+ parseArgumentsOpt(c)
+ listener: handleNoArguments(>)
+ listener: handleSend(c, >)
+ listener: beginBinaryExpression(>)
+ parsePrecedenceExpression(>, 9, true)
+ parseUnaryExpression(>, true)
+ parsePrecedenceExpression(!, 16, true)
+ parseUnaryExpression(!, true)
+ parsePrimary(!, expression)
+ parseParenthesizedExpressionOrFunctionLiteral(!)
+ parseParenthesizedExpression(!)
+ parseExpressionInParenthesis(!)
+ parseExpressionInParenthesisRest(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ isNextIdentifier(()
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(d, expression)
+ listener: handleNoTypeArguments())
+ parseArgumentsOpt(d)
+ listener: handleNoArguments())
+ listener: handleSend(d, ))
+ ensureCloseParen(d, ()
+ listener: handleParenthesizedExpression(()
+ listener: handleUnaryPrefixExpression(!)
+ listener: endBinaryExpression(>)
+ listener: endArguments(2, (, ))
+ listener: handleSend(f, ;)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', operators_lessThan, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(operators_lessThan, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(operators_lessThan, operators_lessThan, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginBinaryExpression(<)
+ parsePrecedenceExpression(<, 9, true)
+ parseUnaryExpression(<, true)
+ parsePrimary(<, expression)
+ parseSendOrFunctionLiteral(<, expression)
+ parseSend(<, expression)
+ isNextIdentifier(<)
+ ensureIdentifier(<, expression)
+ listener: handleIdentifier(a, expression)
+ listener: handleNoTypeArguments(>)
+ parseArgumentsOpt(a)
+ listener: handleNoArguments(>)
+ listener: handleSend(a, >)
+ listener: endBinaryExpression(<)
+ reportRecoverableError(>, EqualityCannotBeEqualityOperand)
+ listener: handleRecoverableError(EqualityCannotBeEqualityOperand, >, >)
+ listener: beginBinaryExpression(>)
+ parsePrecedenceExpression(>, 9, true)
+ parseUnaryExpression(>, true)
+ parsePrimary(>, expression)
+ parseLiteralListSetMapOrFunction(>, null)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(1, <, >)
+ reportRecoverableError(;, Message[ExpectedButGot, Expected '[' before this., null, {string: [}])
+ listener: handleRecoverableError(Message[ExpectedButGot, Expected '[' before this., null, {string: [}], ;, ;)
+ rewriter()
+ parseLiteralListSuffix(>, null)
+ rewriteSquareBrackets(>)
+ link([, ])
+ rewriter()
+ listener: handleLiteralList(0, [, null, ])
+ listener: endBinaryExpression(>)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', operators_minus, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(operators_minus, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(operators_minus, operators_minus, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ looksLikeFunctionBody(;)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(f)
+ parseArguments(f)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ isNextIdentifier(()
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(a, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(a)
+ listener: handleNoArguments(<)
+ listener: handleSend(a, <)
+ listener: beginBinaryExpression(<)
+ parsePrecedenceExpression(<, 9, true)
+ parseUnaryExpression(<, true)
+ parsePrimary(<, expression)
+ parseSendOrFunctionLiteral(<, expression)
+ parseSend(<, expression)
+ isNextIdentifier(<)
+ ensureIdentifier(<, expression)
+ listener: handleIdentifier(b, expression)
+ listener: handleNoTypeArguments(,)
+ parseArgumentsOpt(b)
+ listener: handleNoArguments(,)
+ listener: handleSend(b, ,)
+ listener: endBinaryExpression(<)
+ parseExpression(,)
+ parsePrecedenceExpression(,, 1, true)
+ parseUnaryExpression(,, true)
+ parsePrimary(,, expression)
+ parseSendOrFunctionLiteral(,, expression)
+ parseSend(,, expression)
+ isNextIdentifier(,)
+ ensureIdentifier(,, expression)
+ listener: handleIdentifier(c, expression)
+ listener: handleNoTypeArguments(>)
+ parseArgumentsOpt(c)
+ listener: handleNoArguments(>)
+ listener: handleSend(c, >)
+ listener: beginBinaryExpression(>)
+ parsePrecedenceExpression(>, 9, true)
+ parseUnaryExpression(>, true)
+ parsePrecedenceExpression(-, 16, true)
+ parseUnaryExpression(-, true)
+ parsePrimary(-, expression)
+ parseSendOrFunctionLiteral(-, expression)
+ parseSend(-, expression)
+ isNextIdentifier(-)
+ ensureIdentifier(-, expression)
+ listener: handleIdentifier(d, expression)
+ listener: handleNoTypeArguments())
+ parseArgumentsOpt(d)
+ listener: handleNoArguments())
+ listener: handleSend(d, ))
+ listener: handleUnaryPrefixExpression(-)
+ listener: endBinaryExpression(>)
+ listener: endArguments(2, (, ))
+ listener: handleSend(f, ;)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', operators_openBracket, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(operators_openBracket, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(operators_openBracket, operators_openBracket, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ looksLikeFunctionBody(;)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(f)
+ parseArguments(f)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ isNextIdentifier(()
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(a, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(a)
+ listener: handleNoArguments(<)
+ listener: handleSend(a, <)
+ listener: beginBinaryExpression(<)
+ parsePrecedenceExpression(<, 9, true)
+ parseUnaryExpression(<, true)
+ parsePrimary(<, expression)
+ parseSendOrFunctionLiteral(<, expression)
+ parseSend(<, expression)
+ isNextIdentifier(<)
+ ensureIdentifier(<, expression)
+ listener: handleIdentifier(b, expression)
+ listener: handleNoTypeArguments(,)
+ parseArgumentsOpt(b)
+ listener: handleNoArguments(,)
+ listener: handleSend(b, ,)
+ listener: endBinaryExpression(<)
+ parseExpression(,)
+ parsePrecedenceExpression(,, 1, true)
+ parseUnaryExpression(,, true)
+ parsePrimary(,, expression)
+ parseSendOrFunctionLiteral(,, expression)
+ parseSend(,, expression)
+ isNextIdentifier(,)
+ ensureIdentifier(,, expression)
+ listener: handleIdentifier(c, expression)
+ listener: handleNoTypeArguments(>)
+ parseArgumentsOpt(c)
+ listener: handleNoArguments(>)
+ listener: handleSend(c, >)
+ listener: beginBinaryExpression(>)
+ parsePrecedenceExpression(>, 9, true)
+ parseUnaryExpression(>, true)
+ parsePrimary(>, expression)
+ listener: handleNoTypeArguments([)
+ parseLiteralListSuffix(>, null)
+ parseExpression([)
+ parsePrecedenceExpression([, 1, true)
+ parseUnaryExpression([, true)
+ parsePrimary([, expression)
+ parseSendOrFunctionLiteral([, expression)
+ parseSend([, expression)
+ isNextIdentifier([)
+ ensureIdentifier([, expression)
+ listener: handleIdentifier(d, expression)
+ listener: handleNoTypeArguments(])
+ parseArgumentsOpt(d)
+ listener: handleNoArguments(])
+ listener: handleSend(d, ])
+ listener: handleLiteralList(1, [, null, ])
+ listener: endBinaryExpression(>)
+ listener: endArguments(2, (, ))
+ listener: handleSend(f, ;)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', operators_openBracket_error, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(operators_openBracket_error, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(operators_openBracket_error, operators_openBracket_error, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ looksLikeFunctionBody(;)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(f)
+ parseArguments(f)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ isNextIdentifier(()
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(a, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(a)
+ listener: handleNoArguments(<)
+ listener: handleSend(a, <)
+ listener: beginBinaryExpression(<)
+ parsePrecedenceExpression(<, 9, true)
+ parseUnaryExpression(<, true)
+ parsePrimary(<, expression)
+ parseSendOrFunctionLiteral(<, expression)
+ parseSend(<, expression)
+ isNextIdentifier(<)
+ ensureIdentifier(<, expression)
+ listener: handleIdentifier(b, expression)
+ listener: handleNoTypeArguments(,)
+ parseArgumentsOpt(b)
+ listener: handleNoArguments(,)
+ listener: handleSend(b, ,)
+ listener: endBinaryExpression(<)
+ parseExpression(,)
+ parsePrecedenceExpression(,, 1, true)
+ parseUnaryExpression(,, true)
+ parsePrimary(,, expression)
+ parseSendOrFunctionLiteral(,, expression)
+ parseSend(,, expression)
+ isNextIdentifier(,)
+ ensureIdentifier(,, expression)
+ listener: handleIdentifier(c, expression)
+ listener: handleNoTypeArguments(>)
+ parseArgumentsOpt(c)
+ listener: handleNoArguments(>)
+ listener: handleSend(c, >)
+ listener: beginBinaryExpression(>)
+ parsePrecedenceExpression(>, 9, true)
+ parseUnaryExpression(>, true)
+ parsePrimary(>, expression)
+ listener: handleNoTypeArguments([)
+ parseLiteralListSuffix(>, null)
+ parseExpression([)
+ parsePrecedenceExpression([, 1, true)
+ parseUnaryExpression([, true)
+ parsePrimary([, expression)
+ parseSendOrFunctionLiteral([, expression)
+ parseSend([, expression)
+ isNextIdentifier([)
+ ensureIdentifier([, expression)
+ listener: handleIdentifier(d, expression)
+ listener: handleNoTypeArguments(])
+ parseArgumentsOpt(d)
+ listener: handleNoArguments(])
+ listener: handleSend(d, ])
+ listener: handleLiteralList(1, [, null, ])
+ listener: endBinaryExpression(>)
+ reportRecoverableError(>, EqualityCannotBeEqualityOperand)
+ listener: handleRecoverableError(EqualityCannotBeEqualityOperand, >, >)
+ listener: beginBinaryExpression(>)
+ parsePrecedenceExpression(>, 9, true)
+ parseUnaryExpression(>, true)
+ parsePrimary(>, expression)
+ parseSendOrFunctionLiteral(>, expression)
+ parseSend(>, expression)
+ isNextIdentifier(>)
+ ensureIdentifier(>, expression)
+ listener: handleIdentifier(e, expression)
+ listener: handleNoTypeArguments())
+ parseArgumentsOpt(e)
+ listener: handleNoArguments())
+ listener: handleSend(e, ))
+ listener: endBinaryExpression(>)
+ listener: endArguments(2, (, ))
+ listener: handleSend(f, ;)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', operators_openBracket_unambiguous, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(operators_openBracket_unambiguous, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(operators_openBracket_unambiguous, operators_openBracket_unambiguous, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ looksLikeFunctionBody(;)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(f)
+ parseArguments(f)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ isNextIdentifier(()
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(a, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(a)
+ listener: handleNoArguments(<)
+ listener: handleSend(a, <)
+ listener: beginBinaryExpression(<)
+ parsePrecedenceExpression(<, 9, true)
+ parseUnaryExpression(<, true)
+ parsePrimary(<, expression)
+ parseSendOrFunctionLiteral(<, expression)
+ parseSend(<, expression)
+ isNextIdentifier(<)
+ ensureIdentifier(<, expression)
+ listener: handleIdentifier(b, expression)
+ listener: handleNoTypeArguments(,)
+ parseArgumentsOpt(b)
+ listener: handleNoArguments(,)
+ listener: handleSend(b, ,)
+ listener: endBinaryExpression(<)
+ parseExpression(,)
+ parsePrecedenceExpression(,, 1, true)
+ parseUnaryExpression(,, true)
+ parsePrimary(,, expression)
+ parseSendOrFunctionLiteral(,, expression)
+ parseSend(,, expression)
+ isNextIdentifier(,)
+ ensureIdentifier(,, expression)
+ listener: handleIdentifier(c, expression)
+ listener: handleNoTypeArguments(>)
+ parseArgumentsOpt(c)
+ listener: handleNoArguments(>)
+ listener: handleSend(c, >)
+ listener: beginBinaryExpression(>)
+ parsePrecedenceExpression(>, 9, true)
+ parseUnaryExpression(>, true)
+ parsePrimary(>, expression)
+ listener: handleNoTypeArguments([)
+ parseLiteralListSuffix(>, null)
+ parseExpression([)
+ parsePrecedenceExpression([, 1, true)
+ parseUnaryExpression([, true)
+ parsePrimary([, expression)
+ parseSendOrFunctionLiteral([, expression)
+ parseSend([, expression)
+ isNextIdentifier([)
+ ensureIdentifier([, expression)
+ listener: handleIdentifier(d, expression)
+ listener: handleNoTypeArguments(,)
+ parseArgumentsOpt(d)
+ listener: handleNoArguments(,)
+ listener: handleSend(d, ,)
+ parseExpression(,)
+ parsePrecedenceExpression(,, 1, true)
+ parseUnaryExpression(,, true)
+ parsePrimary(,, expression)
+ parseSendOrFunctionLiteral(,, expression)
+ parseSend(,, expression)
+ isNextIdentifier(,)
+ ensureIdentifier(,, expression)
+ listener: handleIdentifier(e, expression)
+ listener: handleNoTypeArguments(])
+ parseArgumentsOpt(e)
+ listener: handleNoArguments(])
+ listener: handleSend(e, ])
+ listener: handleLiteralList(2, [, null, ])
+ listener: endBinaryExpression(>)
+ listener: endArguments(2, (, ))
+ listener: handleSend(f, ;)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration()
+ reportAllErrorTokens(var)
+ listener: endCompilationUnit(34, )
diff --git a/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.parser.expect b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.parser.expect
new file mode 100644
index 0000000..becf1b6
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.parser.expect
@@ -0,0 +1,159 @@
+NOTICE: Stream was rewritten by parser!
+
+var typeArgs_ampersand = f<a, b> & 0;
+var typeArgs_asterisk = f<a, b> * 0;
+var typeArgs_bar = f<a, b> | 0;
+var typeArgs_caret = f<a, b> ^ 0;
+var typeArgs_closeBrace = {f<a, b>};
+var typeArgs_closeBracket = [f<a, b>];
+var typeArgs_closeParen = g(f<a, b>);
+var typeArgs_colon = {f<a, b>: null};
+var typeArgs_comma = [f<a, b>, null];
+var typeArgs_equals = f<a, b> == null;
+var typeArgs_not_equals = f<a, b> != null;
+
+
+
+var typeArgs_openParen = f<a, b>();
+
+var typeArgs_percent = f<a, b> % 0;
+
+
+
+var typeArgs_period_methodInvocation = f<a, b>.toString();
+
+var typeArgs_period_methodInvocation_generic = f<a, b>.foo<c>();
+var typeArgs_period_period = f<a, b>..toString();
+var typeArgs_period_propertyAccess = f<a, b>.hashCode;
+var typeArgs_plus = f<a, b> + 0;
+
+
+
+
+
+var typeArgs_question = f<a, b> ? null : null;
+
+var typeArgs_question_period_methodInvocation = f<a, b>?.toString();
+var typeArgs_question_period_methodInvocation_generic = f<a, b>?.foo<c>();
+var typeArgs_question_period_period = f<a, b>?..toString();
+var typeArgs_question_period_propertyAccess = f<a, b>?.hashCode;
+var typeArgs_question_question = f<a, b> ?? 0;
+var typeArgs_semicolon = f<a, b>;
+var typeArgs_slash = f<a, b> / 1;
+var typeArgs_tilde_slash = f<a, b> ~/ 1;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var operators_bang_openBracket = f(a<b,c>![d]);
+
+var operators_bang_paren = f(a<b,c>!(d));
+
+
+
+
+
+var operators_lessThan = f<a><b>[];
+
+var operators_minus = f(a<b,c>-d);
+var operators_openBracket = f(a<b,c>[d]);
+
+
+
+
+
+
+var operators_openBracket_error = f(a<b,c>[d]>e);
+
+var operators_openBracket_unambiguous = f(a<b,c>[d, e]);
+
+
+var[KeywordToken] typeArgs_ampersand[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] &[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_asterisk[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] *[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_bar[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] |[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_caret[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ^[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_closeBrace[StringToken] =[SimpleToken] {[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]}[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_closeBracket[StringToken] =[SimpleToken] [[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]][SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_closeParen[StringToken] =[SimpleToken] g[StringToken]([BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_colon[StringToken] =[SimpleToken] {[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]:[SimpleToken] null[KeywordToken]}[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_comma[StringToken] =[SimpleToken] [[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken],[SimpleToken] null[KeywordToken]][SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_equals[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ==[SimpleToken] null[KeywordToken];[SimpleToken]
+var[KeywordToken] typeArgs_not_equals[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] !=[SimpleToken] null[KeywordToken];[SimpleToken]
+
+
+
+var[KeywordToken] typeArgs_openParen[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
+
+var[KeywordToken] typeArgs_percent[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] %[SimpleToken] 0[StringToken];[SimpleToken]
+
+
+
+var[KeywordToken] typeArgs_period_methodInvocation[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
+
+var[KeywordToken] typeArgs_period_methodInvocation_generic[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]foo[StringToken]<[BeginToken]c[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_period_period[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]..[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_period_propertyAccess[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]hashCode[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_plus[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] +[SimpleToken] 0[StringToken];[SimpleToken]
+
+
+
+
+
+var[KeywordToken] typeArgs_question[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ?[SimpleToken] null[KeywordToken] :[SimpleToken] null[KeywordToken];[SimpleToken]
+
+var[KeywordToken] typeArgs_question_period_methodInvocation[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_question_period_methodInvocation_generic[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]foo[StringToken]<[BeginToken]c[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_question_period_period[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?..[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_question_period_propertyAccess[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]hashCode[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_question_question[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ??[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_semicolon[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_slash[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] /[SimpleToken] 1[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_tilde_slash[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ~/[SimpleToken] 1[StringToken];[SimpleToken]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var[KeywordToken] operators_bang_openBracket[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]![SimpleToken][[BeginToken]d[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
+
+var[KeywordToken] operators_bang_paren[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]![SimpleToken]([BeginToken]d[StringToken])[SimpleToken])[SimpleToken];[SimpleToken]
+
+
+
+
+
+var[KeywordToken] operators_lessThan[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken]>[SimpleToken]<[BeginToken]b[StringToken]>[SimpleToken][[SyntheticBeginToken]][SyntheticToken];[SimpleToken]
+
+var[KeywordToken] operators_minus[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]-[SimpleToken]d[StringToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] operators_openBracket[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
+
+
+
+
+
+
+var[KeywordToken] operators_openBracket_error[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken]][SimpleToken]>[SimpleToken]e[StringToken])[SimpleToken];[SimpleToken]
+
+var[KeywordToken] operators_openBracket_unambiguous[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken],[SimpleToken] e[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.scanner.expect b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.scanner.expect
new file mode 100644
index 0000000..32ed486
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.scanner.expect
@@ -0,0 +1,157 @@
+var typeArgs_ampersand = f<a, b> & 0;
+var typeArgs_asterisk = f<a, b> * 0;
+var typeArgs_bar = f<a, b> | 0;
+var typeArgs_caret = f<a, b> ^ 0;
+var typeArgs_closeBrace = {f<a, b>};
+var typeArgs_closeBracket = [f<a, b>];
+var typeArgs_closeParen = g(f<a, b>);
+var typeArgs_colon = {f<a, b>: null};
+var typeArgs_comma = [f<a, b>, null];
+var typeArgs_equals = f<a, b> == null;
+var typeArgs_not_equals = f<a, b> != null;
+
+
+
+var typeArgs_openParen = f<a, b>();
+
+var typeArgs_percent = f<a, b> % 0;
+
+
+
+var typeArgs_period_methodInvocation = f<a, b>.toString();
+
+var typeArgs_period_methodInvocation_generic = f<a, b>.foo<c>();
+var typeArgs_period_period = f<a, b>..toString();
+var typeArgs_period_propertyAccess = f<a, b>.hashCode;
+var typeArgs_plus = f<a, b> + 0;
+
+
+
+
+
+var typeArgs_question = f<a, b> ? null : null;
+
+var typeArgs_question_period_methodInvocation = f<a, b>?.toString();
+var typeArgs_question_period_methodInvocation_generic = f<a, b>?.foo<c>();
+var typeArgs_question_period_period = f<a, b>?..toString();
+var typeArgs_question_period_propertyAccess = f<a, b>?.hashCode;
+var typeArgs_question_question = f<a, b> ?? 0;
+var typeArgs_semicolon = f<a, b>;
+var typeArgs_slash = f<a, b> / 1;
+var typeArgs_tilde_slash = f<a, b> ~/ 1;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var operators_bang_openBracket = f(a<b,c>![d]);
+
+var operators_bang_paren = f(a<b,c>!(d));
+
+
+
+
+
+var operators_lessThan = f<a><b>;
+
+var operators_minus = f(a<b,c>-d);
+var operators_openBracket = f(a<b,c>[d]);
+
+
+
+
+
+
+var operators_openBracket_error = f(a<b,c>[d]>e);
+
+var operators_openBracket_unambiguous = f(a<b,c>[d, e]);
+
+
+var[KeywordToken] typeArgs_ampersand[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] &[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_asterisk[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] *[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_bar[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] |[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_caret[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ^[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_closeBrace[StringToken] =[SimpleToken] {[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]}[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_closeBracket[StringToken] =[SimpleToken] [[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]][SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_closeParen[StringToken] =[SimpleToken] g[StringToken]([BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_colon[StringToken] =[SimpleToken] {[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]:[SimpleToken] null[KeywordToken]}[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_comma[StringToken] =[SimpleToken] [[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken],[SimpleToken] null[KeywordToken]][SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_equals[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ==[SimpleToken] null[KeywordToken];[SimpleToken]
+var[KeywordToken] typeArgs_not_equals[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] !=[SimpleToken] null[KeywordToken];[SimpleToken]
+
+
+
+var[KeywordToken] typeArgs_openParen[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
+
+var[KeywordToken] typeArgs_percent[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] %[SimpleToken] 0[StringToken];[SimpleToken]
+
+
+
+var[KeywordToken] typeArgs_period_methodInvocation[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
+
+var[KeywordToken] typeArgs_period_methodInvocation_generic[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]foo[StringToken]<[BeginToken]c[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_period_period[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]..[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_period_propertyAccess[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]hashCode[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_plus[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] +[SimpleToken] 0[StringToken];[SimpleToken]
+
+
+
+
+
+var[KeywordToken] typeArgs_question[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ?[SimpleToken] null[KeywordToken] :[SimpleToken] null[KeywordToken];[SimpleToken]
+
+var[KeywordToken] typeArgs_question_period_methodInvocation[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_question_period_methodInvocation_generic[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]foo[StringToken]<[BeginToken]c[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_question_period_period[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?..[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_question_period_propertyAccess[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]hashCode[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_question_question[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ??[SimpleToken] 0[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_semicolon[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+var[KeywordToken] typeArgs_slash[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] /[SimpleToken] 1[StringToken];[SimpleToken]
+var[KeywordToken] typeArgs_tilde_slash[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ~/[SimpleToken] 1[StringToken];[SimpleToken]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var[KeywordToken] operators_bang_openBracket[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]![SimpleToken][[BeginToken]d[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
+
+var[KeywordToken] operators_bang_paren[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]![SimpleToken]([BeginToken]d[StringToken])[SimpleToken])[SimpleToken];[SimpleToken]
+
+
+
+
+
+var[KeywordToken] operators_lessThan[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken]>[SimpleToken]<[BeginToken]b[StringToken]>[SimpleToken];[SimpleToken]
+
+var[KeywordToken] operators_minus[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]-[SimpleToken]d[StringToken])[SimpleToken];[SimpleToken]
+var[KeywordToken] operators_openBracket[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
+
+
+
+
+
+
+var[KeywordToken] operators_openBracket_error[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken]][SimpleToken]>[SimpleToken]e[StringToken])[SimpleToken];[SimpleToken]
+
+var[KeywordToken] operators_openBracket_unambiguous[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken],[SimpleToken] e[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/parser_testcases/general/function_reference_kinds.dart b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart
new file mode 100644
index 0000000..41ef715
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart
@@ -0,0 +1,8 @@
+// Copyright (c) 2021, 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.md file.
+
+var simpleIdentifier = f<a, b>;
+var method = f().m<a, b>;
+var prefixedIdentifier = prefix.f<a, b>;
+var three_identifiers = prefix.ClassName.m<a, b>;
diff --git a/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.expect b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.expect
new file mode 100644
index 0000000..c3fdd54
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.expect
@@ -0,0 +1,115 @@
+beginCompilationUnit(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields()
+ handleNoType(var)
+ handleIdentifier(simpleIdentifier, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(method, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(f, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ endArguments(0, (, ))
+ handleSend(f, .)
+ handleIdentifier(m, expressionContinuation)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(m, <)
+ handleEndingBinaryExpression(.)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(prefixedIdentifier, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(prefix, expression)
+ handleNoTypeArguments(.)
+ handleNoArguments(.)
+ handleSend(prefix, .)
+ handleIdentifier(f, expressionContinuation)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(f, <)
+ handleEndingBinaryExpression(.)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration(var)
+ beginMetadataStar(var)
+ endMetadataStar(0)
+ beginTopLevelMember(var)
+ beginFields(;)
+ handleNoType(var)
+ handleIdentifier(three_identifiers, topLevelVariableDeclaration)
+ beginFieldInitializer(=)
+ handleIdentifier(prefix, expression)
+ handleNoTypeArguments(.)
+ handleNoArguments(.)
+ handleSend(prefix, .)
+ handleIdentifier(ClassName, expressionContinuation)
+ handleNoTypeArguments(.)
+ handleNoArguments(.)
+ handleSend(ClassName, .)
+ handleEndingBinaryExpression(.)
+ handleIdentifier(m, expressionContinuation)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(m, <)
+ handleEndingBinaryExpression(.)
+ beginTypeArguments(<)
+ handleIdentifier(a, typeReference)
+ handleNoTypeArguments(,)
+ handleType(a, null)
+ handleIdentifier(b, typeReference)
+ handleNoTypeArguments(>)
+ handleType(b, null)
+ endTypeArguments(2, <, >)
+ handleTypeArgumentApplication(<)
+ endFieldInitializer(=, ;)
+ endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ endTopLevelDeclaration()
+endCompilationUnit(4, )
diff --git a/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.intertwined.expect
new file mode 100644
index 0000000..93e6d37
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.intertwined.expect
@@ -0,0 +1,206 @@
+parseUnit(var)
+ skipErrorTokens(var)
+ listener: beginCompilationUnit(var)
+ syntheticPreviousToken(var)
+ parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
+ parseMetadataStar()
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl()
+ listener: beginTopLevelMember(var)
+ parseFields(, null, null, null, null, null, var, var, Instance of 'NoType', simpleIdentifier, DeclarationKind.TopLevel, null, false)
+ listener: beginFields()
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(simpleIdentifier, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(simpleIdentifier, simpleIdentifier, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', method, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(method, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(method, method, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ looksLikeFunctionBody(.)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(f, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(f)
+ parseArguments(f)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ listener: endArguments(0, (, ))
+ listener: handleSend(f, .)
+ parsePrimary(., expressionContinuation)
+ parseSendOrFunctionLiteral(., expressionContinuation)
+ parseSend(., expressionContinuation)
+ isNextIdentifier(.)
+ ensureIdentifier(., expressionContinuation)
+ listener: handleIdentifier(m, expressionContinuation)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(m)
+ listener: handleNoArguments(<)
+ listener: handleSend(m, <)
+ listener: handleEndingBinaryExpression(.)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', prefixedIdentifier, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(prefixedIdentifier, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(prefixedIdentifier, prefixedIdentifier, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(prefix, expression)
+ listener: handleNoTypeArguments(.)
+ parseArgumentsOpt(prefix)
+ listener: handleNoArguments(.)
+ listener: handleSend(prefix, .)
+ parsePrimary(., expressionContinuation)
+ parseSendOrFunctionLiteral(., expressionContinuation)
+ parseSend(., expressionContinuation)
+ isNextIdentifier(.)
+ ensureIdentifier(., expressionContinuation)
+ listener: handleIdentifier(f, expressionContinuation)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(f)
+ listener: handleNoArguments(<)
+ listener: handleSend(f, <)
+ listener: handleEndingBinaryExpression(.)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration(var)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(var)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(var)
+ parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', three_identifiers, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleNoType(var)
+ ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(three_identifiers, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(three_identifiers, three_identifiers, null, null, null, var, DeclarationKind.TopLevel, null)
+ listener: beginFieldInitializer(=)
+ parseExpression(=)
+ parsePrecedenceExpression(=, 1, true)
+ parseUnaryExpression(=, true)
+ parsePrimary(=, expression)
+ parseSendOrFunctionLiteral(=, expression)
+ parseSend(=, expression)
+ isNextIdentifier(=)
+ ensureIdentifier(=, expression)
+ listener: handleIdentifier(prefix, expression)
+ listener: handleNoTypeArguments(.)
+ parseArgumentsOpt(prefix)
+ listener: handleNoArguments(.)
+ listener: handleSend(prefix, .)
+ parsePrimary(., expressionContinuation)
+ parseSendOrFunctionLiteral(., expressionContinuation)
+ parseSend(., expressionContinuation)
+ isNextIdentifier(.)
+ ensureIdentifier(., expressionContinuation)
+ listener: handleIdentifier(ClassName, expressionContinuation)
+ listener: handleNoTypeArguments(.)
+ parseArgumentsOpt(ClassName)
+ listener: handleNoArguments(.)
+ listener: handleSend(ClassName, .)
+ listener: handleEndingBinaryExpression(.)
+ parsePrimary(., expressionContinuation)
+ parseSendOrFunctionLiteral(., expressionContinuation)
+ parseSend(., expressionContinuation)
+ isNextIdentifier(.)
+ ensureIdentifier(., expressionContinuation)
+ listener: handleIdentifier(m, expressionContinuation)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(m)
+ listener: handleNoArguments(<)
+ listener: handleSend(m, <)
+ listener: handleEndingBinaryExpression(.)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(a, typeReference)
+ listener: handleNoTypeArguments(,)
+ listener: handleType(a, null)
+ listener: handleIdentifier(b, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(b, null)
+ listener: endTypeArguments(2, <, >)
+ listener: handleTypeArgumentApplication(<)
+ listener: endFieldInitializer(=, ;)
+ listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
+ listener: endTopLevelDeclaration()
+ reportAllErrorTokens(var)
+ listener: endCompilationUnit(4, )
diff --git a/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.parser.expect b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.parser.expect
new file mode 100644
index 0000000..f8a341f
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.parser.expect
@@ -0,0 +1,11 @@
+var simpleIdentifier = f<a, b>;
+var method = f().m<a, b>;
+var prefixedIdentifier = prefix.f<a, b>;
+var three_identifiers = prefix.ClassName.m<a, b>;
+
+
+var[KeywordToken] simpleIdentifier[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+var[KeywordToken] method[StringToken] =[SimpleToken] f[StringToken]([BeginToken])[SimpleToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+var[KeywordToken] prefixedIdentifier[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+var[KeywordToken] three_identifiers[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]ClassName[StringToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.scanner.expect b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.scanner.expect
new file mode 100644
index 0000000..f8a341f
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.scanner.expect
@@ -0,0 +1,11 @@
+var simpleIdentifier = f<a, b>;
+var method = f().m<a, b>;
+var prefixedIdentifier = prefix.f<a, b>;
+var three_identifiers = prefix.ClassName.m<a, b>;
+
+
+var[KeywordToken] simpleIdentifier[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+var[KeywordToken] method[StringToken] =[SimpleToken] f[StringToken]([BeginToken])[SimpleToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+var[KeywordToken] prefixedIdentifier[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+var[KeywordToken] three_identifiers[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]ClassName[StringToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/test/comments_on_certain_arguments_tool.dart b/pkg/front_end/test/comments_on_certain_arguments_tool.dart
index 8d1a909..56ddf2e 100644
--- a/pkg/front_end/test/comments_on_certain_arguments_tool.dart
+++ b/pkg/front_end/test/comments_on_certain_arguments_tool.dart
@@ -5,32 +5,52 @@
// @dart = 2.9
import 'dart:convert' show utf8;
+
import 'dart:io'
show Directory, File, FileSystemEntity, exitCode, stdin, stdout;
+import 'package:_fe_analyzer_shared/src/messages/severity.dart' show Severity;
+
import 'package:_fe_analyzer_shared/src/scanner/token.dart'
show CommentToken, Token;
-import 'package:front_end/src/api_prototype/compiler_options.dart' as api;
-import 'package:front_end/src/api_prototype/file_system.dart' as api;
-import 'package:front_end/src/api_unstable/ddc.dart'
- show CompilerContext, IncrementalCompiler, ProcessedOptions, Severity;
+
+import 'package:front_end/src/api_prototype/compiler_options.dart' as api
+ show CompilerOptions, DiagnosticMessage;
+
+import 'package:front_end/src/api_prototype/file_system.dart' as api
+ show FileSystem;
+
+import 'package:front_end/src/base/processed_options.dart'
+ show ProcessedOptions;
+
import 'package:front_end/src/compute_platform_binaries_location.dart'
show computePlatformBinariesLocation;
+
+import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext;
+
import 'package:front_end/src/fasta/dill/dill_target.dart' show DillTarget;
+
import 'package:front_end/src/fasta/incremental_compiler.dart'
show IncrementalCompiler, IncrementalKernelTarget;
+
import 'package:front_end/src/fasta/kernel/kernel_target.dart'
show KernelTarget;
+
import 'package:front_end/src/fasta/source/source_library_builder.dart'
show SourceLibraryBuilder;
+
import 'package:front_end/src/fasta/source/source_loader.dart'
show SourceLoader;
+
import 'package:front_end/src/fasta/uri_translator.dart' show UriTranslator;
-import 'package:kernel/kernel.dart';
+
+import 'package:kernel/ast.dart';
+
import 'package:kernel/target/targets.dart' show TargetFlags;
+
import "package:vm/target/vm.dart" show VmTarget;
-import "utils/io_utils.dart";
+import "utils/io_utils.dart" show computeRepoDirUri;
final Uri repoDir = computeRepoDirUri();
diff --git a/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart b/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart
index 2da47c7f..4cbd8e7 100644
--- a/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart
+++ b/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart
@@ -9,14 +9,20 @@
import 'package:_fe_analyzer_shared/src/messages/diagnostic_message.dart'
show DiagnosticMessage, getMessageCodeObject;
+import 'package:_fe_analyzer_shared/src/messages/severity.dart' show Severity;
+
import 'package:expect/expect.dart' show Expect;
import 'package:front_end/src/api_prototype/compiler_options.dart'
show CompilerOptions;
+import 'package:front_end/src/api_prototype/experimental_flags.dart'
+ show ExperimentalFlag;
+
import "package:front_end/src/api_prototype/memory_file_system.dart"
show MemoryFileSystem;
-import 'package:front_end/src/api_unstable/bazel_worker.dart';
+
+import 'package:front_end/src/base/nnbd_mode.dart' show NnbdMode;
import 'package:front_end/src/base/processed_options.dart'
show ProcessedOptions;
@@ -37,6 +43,8 @@
import 'package:front_end/src/fasta/incremental_compiler.dart'
show IncrementalCompiler;
+import 'package:front_end/src/fasta/kernel/utils.dart' show serializeComponent;
+
import 'package:kernel/kernel.dart'
show Component, Library, NonNullableByDefaultCompiledMode;
diff --git a/pkg/front_end/test/incremental_suite.dart b/pkg/front_end/test/incremental_suite.dart
index b623b65..f340d68 100644
--- a/pkg/front_end/test/incremental_suite.dart
+++ b/pkg/front_end/test/incremental_suite.dart
@@ -23,7 +23,9 @@
import 'package:front_end/src/api_prototype/compiler_options.dart'
show CompilerOptions, parseExperimentalArguments, parseExperimentalFlags;
-import 'package:front_end/src/api_prototype/experimental_flags.dart';
+
+import 'package:front_end/src/api_prototype/experimental_flags.dart'
+ show ExperimentalFlag, experimentEnabledVersion;
import "package:front_end/src/api_prototype/memory_file_system.dart"
show MemoryFileSystem;
@@ -46,20 +48,23 @@
import 'package:front_end/src/fasta/incremental_serializer.dart'
show IncrementalSerializer;
-import 'package:front_end/src/fasta/kernel/kernel_api.dart';
import 'package:front_end/src/fasta/kernel/utils.dart' show ByteSink;
+
import 'package:kernel/ast.dart';
import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder;
import 'package:kernel/binary/ast_to_binary.dart' show BinaryPrinter;
-import 'package:kernel/class_hierarchy.dart';
+
+import 'package:kernel/class_hierarchy.dart'
+ show ClassHierarchy, ClosedWorldClassHierarchy, ForTestingClassInfo;
import 'package:kernel/target/targets.dart'
show NoneTarget, LateLowering, Target, TargetFlags;
-import 'package:kernel/text/ast_to_text.dart' show Printer, componentToString;
+import 'package:kernel/text/ast_to_text.dart'
+ show NameSystem, Printer, componentToString;
import "package:testing/testing.dart"
show Chain, ChainContext, Expectation, Result, Step, TestDescription, runMe;
diff --git a/pkg/front_end/test/multiple_simultaneous_compiles_test.dart b/pkg/front_end/test/multiple_simultaneous_compiles_test.dart
index c64e9fe..3e5d055 100644
--- a/pkg/front_end/test/multiple_simultaneous_compiles_test.dart
+++ b/pkg/front_end/test/multiple_simultaneous_compiles_test.dart
@@ -4,11 +4,17 @@
// @dart = 2.9
-import 'dart:io';
+import 'dart:io' show File, Platform;
-import 'package:front_end/src/api_unstable/vm.dart';
-import 'package:front_end/src/fasta/incremental_compiler.dart';
-import 'package:kernel/ast.dart';
+import 'package:front_end/src/base/processed_options.dart'
+ show ProcessedOptions;
+
+import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext;
+
+import 'package:front_end/src/fasta/incremental_compiler.dart'
+ show IncrementalCompiler;
+
+import 'package:kernel/ast.dart' show Component;
import 'incremental_suite.dart' show getOptions;
diff --git a/pkg/front_end/test/parser_test_listener.dart b/pkg/front_end/test/parser_test_listener.dart
index c3a0373..ca40095 100644
--- a/pkg/front_end/test/parser_test_listener.dart
+++ b/pkg/front_end/test/parser_test_listener.dart
@@ -2209,4 +2209,9 @@
void handleNoCommentReference() {
doPrint('handleNoCommentReference()');
}
+
+ void handleTypeArgumentApplication(Token openAngleBracket) {
+ seen(openAngleBracket);
+ doPrint('handleTypeArgumentApplication(' '$openAngleBracket)');
+ }
}
diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt
index a1b8799..dab3f99 100644
--- a/pkg/front_end/test/spell_checking_list_code.txt
+++ b/pkg/front_end/test/spell_checking_list_code.txt
@@ -23,6 +23,7 @@
activated
adequate
adi
+advantage
affecting
afterwards
agree
@@ -300,6 +301,7 @@
degree
del
delimit
+delimiting
demands
demangle
demangled
@@ -333,6 +335,7 @@
dirtifying
dirty
disallow
+disambiguating
disambiguator
disjoint
dispatched
@@ -611,6 +614,7 @@
invariants
io
is64
+isolated
issuecomment
issuing
iterables
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index 5136f0f..5b999be 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -42,6 +42,7 @@
asdf
asserter
assure
+asterisk
auth
authority
autobianchi
@@ -145,6 +146,7 @@
columns
commented
commit
+commits
companion
comparative
comparer
@@ -497,11 +499,13 @@
logd
logs
loo
+lookahead
loopback
mac
maker
matters
mds
+meaningless
measured
method1d
metric
@@ -541,6 +545,7 @@
nondefault
nonexisting
noo
+noted
numerator
ob
obool
@@ -642,6 +647,7 @@
regenerate
regressions
reify
+reject
reload
remap
remaps
diff --git a/pkg/front_end/test/spelling_test_base.dart b/pkg/front_end/test/spelling_test_base.dart
index 1c3a3ff..a7dd236 100644
--- a/pkg/front_end/test/spelling_test_base.dart
+++ b/pkg/front_end/test/spelling_test_base.dart
@@ -10,7 +10,8 @@
import 'package:_fe_analyzer_shared/src/scanner/scanner.dart' show ErrorToken;
-import 'package:_fe_analyzer_shared/src/scanner/token.dart';
+import 'package:_fe_analyzer_shared/src/scanner/token.dart'
+ show BeginToken, KeywordToken, StringToken, Token;
import 'package:_fe_analyzer_shared/src/scanner/utf8_bytes_scanner.dart'
show Utf8BytesScanner;
@@ -18,7 +19,7 @@
import 'package:front_end/src/fasta/command_line_reporting.dart'
as command_line_reporting;
-import 'package:kernel/kernel.dart';
+import 'package:kernel/kernel.dart' show Location, Source;
import 'package:testing/testing.dart'
show Chain, ChainContext, Result, Step, TestDescription;
diff --git a/pkg/front_end/test/static_types/analysis_helper.dart b/pkg/front_end/test/static_types/analysis_helper.dart
index 2c50697..3ae2d5b 100644
--- a/pkg/front_end/test/static_types/analysis_helper.dart
+++ b/pkg/front_end/test/static_types/analysis_helper.dart
@@ -9,8 +9,9 @@
import 'package:_fe_analyzer_shared/src/messages/diagnostic_message.dart';
import 'package:expect/expect.dart';
-import 'package:front_end/src/api_prototype/front_end.dart';
-import 'package:front_end/src/api_unstable/ddc.dart';
+import 'package:front_end/src/api_prototype/compiler_options.dart';
+import 'package:front_end/src/api_prototype/kernel_generator.dart';
+import 'package:front_end/src/api_prototype/terminal_color_support.dart';
import 'package:front_end/src/compute_platform_binaries_location.dart';
import 'package:front_end/src/fasta/command_line_reporting.dart';
import 'package:front_end/src/fasta/fasta_codes.dart';
diff --git a/pkg/front_end/testcases/general/issue44347.dart.weak.expect b/pkg/front_end/testcases/general/issue44347.dart.weak.expect
index df1f308..23f91b5 100644
--- a/pkg/front_end/testcases/general/issue44347.dart.weak.expect
+++ b/pkg/front_end/testcases/general/issue44347.dart.weak.expect
@@ -2,16 +2,27 @@
//
// Problems in library:
//
+// pkg/front_end/testcases/general/issue44347.dart:6:6: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// Set<int>.();
+// ^
+//
+// pkg/front_end/testcases/general/issue44347.dart:6:13: Error: Expected an identifier, but got ')'.
+// Try inserting an identifier before ')'.
+// Set<int>.();
+// ^
+//
// pkg/front_end/testcases/general/issue44347.dart:6:12: Error: Expected an identifier, but got '('.
// Try inserting an identifier before '('.
// Set<int>.();
// ^
//
import self as self;
-import "dart:collection" as col;
-import "dart:core" as core;
static method test() → dynamic {
- col::LinkedHashSet::•<core::int*>();
+ invalid-expression "pkg/front_end/testcases/general/issue44347.dart:6:12: Error: Expected an identifier, but got '('.
+Try inserting an identifier before '('.
+ Set<int>.();
+ ^";
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/general/issue44347.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue44347.dart.weak.transformed.expect
index a3adab2..23f91b5 100644
--- a/pkg/front_end/testcases/general/issue44347.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general/issue44347.dart.weak.transformed.expect
@@ -2,16 +2,27 @@
//
// Problems in library:
//
+// pkg/front_end/testcases/general/issue44347.dart:6:6: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// Set<int>.();
+// ^
+//
+// pkg/front_end/testcases/general/issue44347.dart:6:13: Error: Expected an identifier, but got ')'.
+// Try inserting an identifier before ')'.
+// Set<int>.();
+// ^
+//
// pkg/front_end/testcases/general/issue44347.dart:6:12: Error: Expected an identifier, but got '('.
// Try inserting an identifier before '('.
// Set<int>.();
// ^
//
import self as self;
-import "dart:collection" as col;
-import "dart:core" as core;
static method test() → dynamic {
- new col::_CompactLinkedHashSet::•<core::int*>();
+ invalid-expression "pkg/front_end/testcases/general/issue44347.dart:6:12: Error: Expected an identifier, but got '('.
+Try inserting an identifier before '('.
+ Set<int>.();
+ ^";
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart
index 93a9e56..502a159 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart
@@ -6,7 +6,7 @@
library test;
List<T> f<T>(T g()) => <T>[g()];
-var v = (f<dynamic>)(/*@returnType=int**/() {
+var v = (f<dynamic>)/*@typeArgs=int**/(/*@returnType=int**/() {
return 1;
});
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.textual_outline.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.textual_outline.expect
index 57b0e1a..a630be5 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.textual_outline.expect
@@ -1,5 +1,5 @@
// @dart = 2.9
library test;
List<T> f<T>(T g()) => <T>[g()];
-var v = (f<dynamic>)( () { return 1; });
+var v = (f<dynamic>) ( () { return 1; });
main() {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.expect
index ab6bbb7..c90ed22 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.expect
@@ -2,34 +2,21 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:19: Error: A comparison expression can't be an operand of another comparison expression.
-// Try putting parentheses around one of the comparisons.
-// var v = (f<dynamic>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: Expected an identifier, but got ')'.
-// Try inserting an identifier before ')'.
-// var v = (f<dynamic>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
-// - 'List' is from 'dart:core'.
-// Try correcting the operator to an existing operator, or defining a '<' operator.
-// var v = (f<dynamic>)(/*@returnType=int**/() {
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var v = (f<dynamic>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
-static field dynamic v = invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
- - 'List' is from 'dart:core'.
-Try correcting the operator to an existing operator, or defining a '<' operator.
-var v = (f<dynamic>)(/*@returnType=int**/() {
- ^"{dynamic}.>(invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: This couldn't be parsed.
-var v = (f<dynamic>)(/*@returnType=int**/() {
- ^"){dynamic}.call(() → core::int* {
+static field core::List<core::int*>* v = (#C1)<core::int*>(() → core::int* {
return 1;
-});
+}){(() →* core::int*) →* core::List<core::int*>*};
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
return <self::f::T*>[g(){() →* self::f::T*}];
static method main() → dynamic {}
+
+constants {
+ #C1 = tearoff self::f
+}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.outline.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.outline.expect
index 91c3ff0..ff81030 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.outline.expect
@@ -2,20 +2,15 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:19: Error: A comparison expression can't be an operand of another comparison expression.
-// Try putting parentheses around one of the comparisons.
-// var v = (f<dynamic>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: Expected an identifier, but got ')'.
-// Try inserting an identifier before ')'.
-// var v = (f<dynamic>)(/*@returnType=int**/() {
-// ^
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var v = (f<dynamic>)/*@typeArgs=int**/(/*@returnType=int**/() {
+// ^
//
import self as self;
import "dart:core" as core;
-static field dynamic v;
+static field core::List<core::int*>* v;
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
;
static method main() → dynamic
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.transformed.expect
index 96fca33..2c7a1d7 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart.weak.transformed.expect
@@ -2,34 +2,21 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:19: Error: A comparison expression can't be an operand of another comparison expression.
-// Try putting parentheses around one of the comparisons.
-// var v = (f<dynamic>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: Expected an identifier, but got ')'.
-// Try inserting an identifier before ')'.
-// var v = (f<dynamic>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
-// - 'List' is from 'dart:core'.
-// Try correcting the operator to an existing operator, or defining a '<' operator.
-// var v = (f<dynamic>)(/*@returnType=int**/() {
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var v = (f<dynamic>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
-static field dynamic v = invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
- - 'List' is from 'dart:core'.
-Try correcting the operator to an existing operator, or defining a '<' operator.
-var v = (f<dynamic>)(/*@returnType=int**/() {
- ^"{dynamic}.>(invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: This couldn't be parsed.
-var v = (f<dynamic>)(/*@returnType=int**/() {
- ^"){dynamic}.call(() → core::int* {
+static field core::List<core::int*>* v = (#C1)<core::int*>(() → core::int* {
return 1;
-});
+}){(() →* core::int*) →* core::List<core::int*>*};
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
return core::_GrowableList::_literal1<self::f::T*>(g(){() →* self::f::T*});
static method main() → dynamic {}
+
+constants {
+ #C1 = tearoff self::f
+}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart
index b147aac..da80b1a 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart
@@ -6,7 +6,7 @@
library test;
List<T> f<T>(T g()) => <T>[g()];
-var v = (f<int>)(/*@returnType=int**/() {
+var v = (f<int>)/*@typeArgs=int**/(/*@returnType=int**/() {
return 1;
});
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.textual_outline.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.textual_outline.expect
index 8194b88..9b37c02 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.textual_outline.expect
@@ -1,5 +1,5 @@
// @dart = 2.9
library test;
List<T> f<T>(T g()) => <T>[g()];
-var v = (f<int>)( () { return 1; });
+var v = (f<int>) ( () { return 1; });
main() {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.expect
index d66c0af..d25a131 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.expect
@@ -2,34 +2,21 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:15: Error: A comparison expression can't be an operand of another comparison expression.
-// Try putting parentheses around one of the comparisons.
-// var v = (f<int>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: Expected an identifier, but got ')'.
-// Try inserting an identifier before ')'.
-// var v = (f<int>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
-// - 'List' is from 'dart:core'.
-// Try correcting the operator to an existing operator, or defining a '<' operator.
-// var v = (f<int>)(/*@returnType=int**/() {
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var v = (f<int>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
-static field dynamic v = invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
- - 'List' is from 'dart:core'.
-Try correcting the operator to an existing operator, or defining a '<' operator.
-var v = (f<int>)(/*@returnType=int**/() {
- ^"{dynamic}.>(invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: This couldn't be parsed.
-var v = (f<int>)(/*@returnType=int**/() {
- ^"){dynamic}.call(() → core::int* {
+static field core::List<core::int*>* v = (#C1)<core::int*>(() → core::int* {
return 1;
-});
+}){(() →* core::int*) →* core::List<core::int*>*};
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
return <self::f::T*>[g(){() →* self::f::T*}];
static method main() → dynamic {}
+
+constants {
+ #C1 = tearoff self::f
+}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.outline.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.outline.expect
index ac5f82d..337c89c 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.outline.expect
@@ -2,20 +2,15 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:15: Error: A comparison expression can't be an operand of another comparison expression.
-// Try putting parentheses around one of the comparisons.
-// var v = (f<int>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: Expected an identifier, but got ')'.
-// Try inserting an identifier before ')'.
-// var v = (f<int>)(/*@returnType=int**/() {
-// ^
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var v = (f<int>)/*@typeArgs=int**/(/*@returnType=int**/() {
+// ^
//
import self as self;
import "dart:core" as core;
-static field dynamic v;
+static field core::List<core::int*>* v;
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
;
static method main() → dynamic
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.transformed.expect
index 6c6b1ff..6d9032c 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart.weak.transformed.expect
@@ -2,34 +2,21 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:15: Error: A comparison expression can't be an operand of another comparison expression.
-// Try putting parentheses around one of the comparisons.
-// var v = (f<int>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: Expected an identifier, but got ')'.
-// Try inserting an identifier before ')'.
-// var v = (f<int>)(/*@returnType=int**/() {
-// ^
-//
-// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
-// - 'List' is from 'dart:core'.
-// Try correcting the operator to an existing operator, or defining a '<' operator.
-// var v = (f<int>)(/*@returnType=int**/() {
+// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var v = (f<int>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
-static field dynamic v = invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
- - 'List' is from 'dart:core'.
-Try correcting the operator to an existing operator, or defining a '<' operator.
-var v = (f<int>)(/*@returnType=int**/() {
- ^"{dynamic}.>(invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: This couldn't be parsed.
-var v = (f<int>)(/*@returnType=int**/() {
- ^"){dynamic}.call(() → core::int* {
+static field core::List<core::int*>* v = (#C1)<core::int*>(() → core::int* {
return 1;
-});
+}){(() →* core::int*) →* core::List<core::int*>*};
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
return core::_GrowableList::_literal1<self::f::T*>(g(){() →* self::f::T*});
static method main() → dynamic {}
+
+constants {
+ #C1 = tearoff self::f
+}
diff --git a/pkg/front_end/testcases/regress/issue_31188.dart.textual_outline.expect b/pkg/front_end/testcases/regress/issue_31188.dart.textual_outline.expect
index a967c78..2c07051 100644
--- a/pkg/front_end/testcases/regress/issue_31188.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/regress/issue_31188.dart.textual_outline.expect
@@ -1,4 +1,3 @@
// @dart = 2.9
main() {}
-type T = Map<A, B;
->
+type T = Map<A, B> ;
diff --git a/pkg/front_end/testcases/regress/issue_31188.dart.weak.expect b/pkg/front_end/testcases/regress/issue_31188.dart.weak.expect
index d20d13f..cdeea07 100644
--- a/pkg/front_end/testcases/regress/issue_31188.dart.weak.expect
+++ b/pkg/front_end/testcases/regress/issue_31188.dart.weak.expect
@@ -2,11 +2,7 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: Expected ';' after this.
-// type T = Map<A, B>
-// ^
-//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected a declaration, but got '>'.
+// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected ';' after this.
// type T = Map<A, B>
// ^
//
@@ -18,22 +14,25 @@
// type T = Map<A, B>
// ^^^^
//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:14: Error: Getter not found: 'A'.
+// pkg/front_end/testcases/regress/issue_31188.dart:7:14: Error: 'A' isn't a type.
// type T = Map<A, B>
// ^
//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: The operator '<' isn't defined for the class 'Type'.
-// - 'Type' is from 'dart:core'.
-// Try correcting the operator to an existing operator, or defining a '<' operator.
+// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: 'B' isn't a type.
+// type T = Map<A, B>
+// ^
+//
+// pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// type T = Map<A, B>
// ^
//
import self as self;
+import "dart:core" as core;
-static field invalid-type T = invalid-expression "pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: The operator '<' isn't defined for the class 'Type'.
- - 'Type' is from 'dart:core'.
-Try correcting the operator to an existing operator, or defining a '<' operator.
-type T = Map<A, B>
- ^";
-static field invalid-type B;
+static field invalid-type T = #C1;
static method main() → dynamic {}
+
+constants {
+ #C1 = TypeLiteralConstant(core::Map<dynamic, dynamic>*)
+}
diff --git a/pkg/front_end/testcases/regress/issue_31188.dart.weak.outline.expect b/pkg/front_end/testcases/regress/issue_31188.dart.weak.outline.expect
index a5b32ff..71e9e57 100644
--- a/pkg/front_end/testcases/regress/issue_31188.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_31188.dart.weak.outline.expect
@@ -2,11 +2,7 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: Expected ';' after this.
-// type T = Map<A, B>
-// ^
-//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected a declaration, but got '>'.
+// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected ';' after this.
// type T = Map<A, B>
// ^
//
@@ -17,6 +13,5 @@
import self as self;
static field invalid-type T;
-static field invalid-type B;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/regress/issue_31188.dart.weak.transformed.expect b/pkg/front_end/testcases/regress/issue_31188.dart.weak.transformed.expect
index d20d13f..cdeea07 100644
--- a/pkg/front_end/testcases/regress/issue_31188.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31188.dart.weak.transformed.expect
@@ -2,11 +2,7 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: Expected ';' after this.
-// type T = Map<A, B>
-// ^
-//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected a declaration, but got '>'.
+// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected ';' after this.
// type T = Map<A, B>
// ^
//
@@ -18,22 +14,25 @@
// type T = Map<A, B>
// ^^^^
//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:14: Error: Getter not found: 'A'.
+// pkg/front_end/testcases/regress/issue_31188.dart:7:14: Error: 'A' isn't a type.
// type T = Map<A, B>
// ^
//
-// pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: The operator '<' isn't defined for the class 'Type'.
-// - 'Type' is from 'dart:core'.
-// Try correcting the operator to an existing operator, or defining a '<' operator.
+// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: 'B' isn't a type.
+// type T = Map<A, B>
+// ^
+//
+// pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// type T = Map<A, B>
// ^
//
import self as self;
+import "dart:core" as core;
-static field invalid-type T = invalid-expression "pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: The operator '<' isn't defined for the class 'Type'.
- - 'Type' is from 'dart:core'.
-Try correcting the operator to an existing operator, or defining a '<' operator.
-type T = Map<A, B>
- ^";
-static field invalid-type B;
+static field invalid-type T = #C1;
static method main() → dynamic {}
+
+constants {
+ #C1 = TypeLiteralConstant(core::Map<dynamic, dynamic>*)
+}
diff --git a/pkg/front_end/testcases/regress/issue_34403.dart.weak.expect b/pkg/front_end/testcases/regress/issue_34403.dart.weak.expect
index 681977f..5391261 100644
--- a/pkg/front_end/testcases/regress/issue_34403.dart.weak.expect
+++ b/pkg/front_end/testcases/regress/issue_34403.dart.weak.expect
@@ -12,6 +12,11 @@
// var c2 = new C.bar<int>();
// ^^^
//
+// pkg/front_end/testcases/regress/issue_34403.dart:20:13: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var c3 = C<String>.bar<int>();
+// ^
+//
// pkg/front_end/testcases/regress/issue_34403.dart:20:22: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// var c3 = C<String>.bar<int>();
@@ -32,6 +37,11 @@
// const d2 = const D.foo<int>();
// ^^^
//
+// pkg/front_end/testcases/regress/issue_34403.dart:29:15: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// const d3 = D<String>.foo<int>();
+// ^
+//
// pkg/front_end/testcases/regress/issue_34403.dart:29:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// const d3 = D<String>.foo<int>();
@@ -52,6 +62,11 @@
// var e2 = new p.E.bar<int>();
// ^^^
//
+// pkg/front_end/testcases/regress/issue_34403.dart:38:15: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var e3 = p.E<String>.bar<int>();
+// ^
+//
// pkg/front_end/testcases/regress/issue_34403.dart:38:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// var e3 = p.E<String>.bar<int>();
@@ -72,6 +87,11 @@
// const f2 = const p.F.foo<int>();
// ^^^
//
+// pkg/front_end/testcases/regress/issue_34403.dart:47:17: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// const f3 = p.F<String>.foo<int>();
+// ^
+//
// pkg/front_end/testcases/regress/issue_34403.dart:47:26: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// const f3 = p.F<String>.foo<int>();
@@ -123,25 +143,25 @@
c1.{self::C::toString}(){() →* core::String*};
self::C<core::int*>* c2 = new self::C::bar<core::int*>();
c2.{self::C::toString}(){() →* core::String*};
- self::C<core::String*>* c3 = new self::C::bar<core::String*>();
+ self::C<core::int*>* c3 = new self::C::bar<core::int*>();
c3.{self::C::toString}(){() →* core::String*};
self::C<core::String*>* c4 = new self::C::bar<core::String*>();
c4.{self::C::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
- (#C2).{self::D::toString}(){() →* core::String*};
+ (#C1).{self::D::toString}(){() →* core::String*};
(#C2).{self::D::toString}(){() →* core::String*};
iss::E<core::int*>* e1 = new iss::E::bar<core::int*>();
e1.{iss::E::toString}(){() →* core::String*};
iss::E<dynamic>* e2 = new iss::E::bar<dynamic>();
e2.{iss::E::toString}(){() →* core::String*};
- iss::E<core::String*>* e3 = new iss::E::bar<core::String*>();
+ iss::E<core::int*>* e3 = new iss::E::bar<core::int*>();
e3.{iss::E::toString}(){() →* core::String*};
iss::E<core::String*>* e4 = new iss::E::bar<core::String*>();
e4.{iss::E::toString}(){() →* core::String*};
(#C3).{iss::F::toString}(){() →* core::String*};
(#C4).{iss::F::toString}(){() →* core::String*};
- (#C5).{iss::F::toString}(){() →* core::String*};
+ (#C3).{iss::F::toString}(){() →* core::String*};
(#C5).{iss::F::toString}(){() →* core::String*};
}
diff --git a/pkg/front_end/testcases/regress/issue_34403.dart.weak.transformed.expect b/pkg/front_end/testcases/regress/issue_34403.dart.weak.transformed.expect
index 681977f..5391261 100644
--- a/pkg/front_end/testcases/regress/issue_34403.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_34403.dart.weak.transformed.expect
@@ -12,6 +12,11 @@
// var c2 = new C.bar<int>();
// ^^^
//
+// pkg/front_end/testcases/regress/issue_34403.dart:20:13: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var c3 = C<String>.bar<int>();
+// ^
+//
// pkg/front_end/testcases/regress/issue_34403.dart:20:22: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// var c3 = C<String>.bar<int>();
@@ -32,6 +37,11 @@
// const d2 = const D.foo<int>();
// ^^^
//
+// pkg/front_end/testcases/regress/issue_34403.dart:29:15: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// const d3 = D<String>.foo<int>();
+// ^
+//
// pkg/front_end/testcases/regress/issue_34403.dart:29:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// const d3 = D<String>.foo<int>();
@@ -52,6 +62,11 @@
// var e2 = new p.E.bar<int>();
// ^^^
//
+// pkg/front_end/testcases/regress/issue_34403.dart:38:15: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// var e3 = p.E<String>.bar<int>();
+// ^
+//
// pkg/front_end/testcases/regress/issue_34403.dart:38:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// var e3 = p.E<String>.bar<int>();
@@ -72,6 +87,11 @@
// const f2 = const p.F.foo<int>();
// ^^^
//
+// pkg/front_end/testcases/regress/issue_34403.dart:47:17: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
+// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
+// const f3 = p.F<String>.foo<int>();
+// ^
+//
// pkg/front_end/testcases/regress/issue_34403.dart:47:26: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// const f3 = p.F<String>.foo<int>();
@@ -123,25 +143,25 @@
c1.{self::C::toString}(){() →* core::String*};
self::C<core::int*>* c2 = new self::C::bar<core::int*>();
c2.{self::C::toString}(){() →* core::String*};
- self::C<core::String*>* c3 = new self::C::bar<core::String*>();
+ self::C<core::int*>* c3 = new self::C::bar<core::int*>();
c3.{self::C::toString}(){() →* core::String*};
self::C<core::String*>* c4 = new self::C::bar<core::String*>();
c4.{self::C::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
- (#C2).{self::D::toString}(){() →* core::String*};
+ (#C1).{self::D::toString}(){() →* core::String*};
(#C2).{self::D::toString}(){() →* core::String*};
iss::E<core::int*>* e1 = new iss::E::bar<core::int*>();
e1.{iss::E::toString}(){() →* core::String*};
iss::E<dynamic>* e2 = new iss::E::bar<dynamic>();
e2.{iss::E::toString}(){() →* core::String*};
- iss::E<core::String*>* e3 = new iss::E::bar<core::String*>();
+ iss::E<core::int*>* e3 = new iss::E::bar<core::int*>();
e3.{iss::E::toString}(){() →* core::String*};
iss::E<core::String*>* e4 = new iss::E::bar<core::String*>();
e4.{iss::E::toString}(){() →* core::String*};
(#C3).{iss::F::toString}(){() →* core::String*};
(#C4).{iss::F::toString}(){() →* core::String*};
- (#C5).{iss::F::toString}(){() →* core::String*};
+ (#C3).{iss::F::toString}(){() →* core::String*};
(#C5).{iss::F::toString}(){() →* core::String*};
}
diff --git a/pkg/front_end/tool/kernel_ast_file_rewriter.dart b/pkg/front_end/tool/kernel_ast_file_rewriter.dart
index eaa6bcc..7f3e6da 100644
--- a/pkg/front_end/tool/kernel_ast_file_rewriter.dart
+++ b/pkg/front_end/tool/kernel_ast_file_rewriter.dart
@@ -7,10 +7,14 @@
import "dart:io" show File, Platform, stdout;
import "dart:typed_data" show Uint8List;
-import 'package:_fe_analyzer_shared/src/scanner/token.dart';
-import "package:front_end/src/fasta/util/direct_parser_ast.dart";
import 'package:_fe_analyzer_shared/src/parser/parser.dart'
show IdentifierContext;
+
+import 'package:_fe_analyzer_shared/src/scanner/token.dart'
+ show CommentToken, Token;
+
+import "package:front_end/src/fasta/util/direct_parser_ast.dart";
+
import 'package:front_end/src/fasta/util/direct_parser_ast_helper.dart';
void main(List<String> args) {
diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc
index a7a04be..503bb93 100644
--- a/runtime/vm/clustered_snapshot.cc
+++ b/runtime/vm/clustered_snapshot.cc
@@ -4020,8 +4020,7 @@
if (Snapshot::IncludesCode(d->kind())) {
for (intptr_t id = start_index_; id < stop_index_; id++) {
type ^= refs.At(id);
- stub = type.type_test_stub();
- type.SetTypeTestingStub(stub); // Update type_test_stub_entry_point_
+ type.UpdateTypeTestingStubEntryPoint();
}
} else {
for (intptr_t id = start_index_; id < stop_index_; id++) {
@@ -4154,8 +4153,7 @@
if (Snapshot::IncludesCode(d->kind())) {
for (intptr_t id = start_index_; id < stop_index_; id++) {
type ^= refs.At(id);
- stub = type.type_test_stub();
- type.SetTypeTestingStub(stub); // Update type_test_stub_entry_point_
+ type.UpdateTypeTestingStubEntryPoint();
}
} else {
for (intptr_t id = start_index_; id < stop_index_; id++) {
@@ -4245,9 +4243,7 @@
if (Snapshot::IncludesCode(d->kind())) {
for (intptr_t id = start_index_; id < stop_index_; id++) {
type_ref ^= refs.At(id);
- stub = type_ref.type_test_stub();
- type_ref.SetTypeTestingStub(
- stub); // Update type_test_stub_entry_point_
+ type_ref.UpdateTypeTestingStubEntryPoint();
}
} else {
for (intptr_t id = start_index_; id < stop_index_; id++) {
@@ -4380,9 +4376,7 @@
if (Snapshot::IncludesCode(d->kind())) {
for (intptr_t id = start_index_; id < stop_index_; id++) {
type_param ^= refs.At(id);
- stub = type_param.type_test_stub();
- type_param.SetTypeTestingStub(
- stub); // Update type_test_stub_entry_point_
+ type_param.UpdateTypeTestingStubEntryPoint();
}
} else {
for (intptr_t id = start_index_; id < stop_index_; id++) {
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index c3361b3..d6a92d4 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -8111,6 +8111,10 @@
CodePtr type_test_stub() const { return untag()->type_test_stub(); }
void SetTypeTestingStub(const Code& stub) const;
+ void UpdateTypeTestingStubEntryPoint() const {
+ StoreNonPointer(&untag()->type_test_stub_entry_point_,
+ Code::EntryPointOf(untag()->type_test_stub()));
+ }
// No instances of type AbstractType are allocated, but InstanceSize() and
// NextFieldOffset() are required to register class _AbstractType.
diff --git a/samples/ffi/resource_management/arena.dart b/samples/ffi/resource_management/arena.dart
new file mode 100644
index 0000000..8d30382
--- /dev/null
+++ b/samples/ffi/resource_management/arena.dart
@@ -0,0 +1,182 @@
+// 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.
+//
+// Explicit arena used for managing resources.
+
+import 'dart:async';
+import 'dart:ffi';
+
+import 'package:ffi/ffi.dart';
+
+/// An [Allocator] which frees all allocations at the same time.
+///
+/// The arena allows you to allocate heap memory, but ignores calls to [free].
+/// Instead you call [releaseAll] to release all the allocations at the same
+/// time.
+///
+/// Also allows other resources to be associated with the arena, through the
+/// [using] method, to have a release function called for them when the arena is
+/// released.
+///
+/// An [Allocator] can be provided to do the actual allocation and freeing.
+/// Defaults to using [calloc].
+class Arena implements Allocator {
+ /// The [Allocator] used for allocation and freeing.
+ final Allocator _wrappedAllocator;
+
+ /// Native memory under management by this [Arena].
+ final List<Pointer<NativeType>> _managedMemoryPointers = [];
+
+ /// Callbacks for releasing native resources under management by this [Arena].
+ final List<void Function()> _managedResourceReleaseCallbacks = [];
+
+ bool _inUse = true;
+
+ /// Creates a arena of allocations.
+ ///
+ /// The [allocator] is used to do the actual allocation and freeing of
+ /// memory. It defaults to using [calloc].
+ Arena([Allocator allocator = calloc]) : _wrappedAllocator = allocator;
+
+ /// Allocates memory and includes it in the arena.
+ ///
+ /// Uses the allocator provided to the [Arena] constructor to do the
+ /// allocation.
+ ///
+ /// Throws an [ArgumentError] if the number of bytes or alignment cannot be
+ /// satisfied.
+ @override
+ Pointer<T> allocate<T extends NativeType>(int byteCount, {int? alignment}) {
+ _ensureInUse();
+ final p = _wrappedAllocator.allocate<T>(byteCount, alignment: alignment);
+ _managedMemoryPointers.add(p);
+ return p;
+ }
+
+ /// Registers [resource] in this arena.
+ ///
+ /// Executes [releaseCallback] on [releaseAll].
+ ///
+ /// Returns [resource] again, to allow for easily inserting
+ /// `arena.using(resource, ...)` where the resource is allocated.
+ T using<T>(T resource, void Function(T) releaseCallback) {
+ _ensureInUse();
+ releaseCallback = Zone.current.bindUnaryCallback(releaseCallback);
+ _managedResourceReleaseCallbacks.add(() => releaseCallback(resource));
+ return resource;
+ }
+
+ /// Registers [releaseResourceCallback] to be executed on [releaseAll].
+ void onReleaseAll(void Function() releaseResourceCallback) {
+ _managedResourceReleaseCallbacks.add(releaseResourceCallback);
+ }
+
+ /// Releases all resources that this [Arena] manages.
+ ///
+ /// If [reuse] is `true`, the arena can be used again after resources
+ /// have been released. If not, the default, then the [allocate]
+ /// and [using] methods must not be called after a call to `releaseAll`.
+ ///
+ /// If any of the callbacks throw, [releaseAll] is interrupted, and should
+ /// be started again.
+ void releaseAll({bool reuse = false}) {
+ if (!reuse) {
+ _inUse = false;
+ }
+ // The code below is deliberately wirtten to allow allocations to happen
+ // during `releaseAll(reuse:true)`. The arena will still be guaranteed
+ // empty when the `releaseAll` call returns.
+ while (_managedResourceReleaseCallbacks.isNotEmpty) {
+ _managedResourceReleaseCallbacks.removeLast()();
+ }
+ for (final p in _managedMemoryPointers) {
+ _wrappedAllocator.free(p);
+ }
+ _managedMemoryPointers.clear();
+ }
+
+ /// Does nothing, invoke [releaseAll] instead.
+ @override
+ void free(Pointer<NativeType> pointer) {}
+
+ void _ensureInUse() {
+ if (!_inUse) {
+ throw StateError(
+ 'Arena no longer in use, `releaseAll(reuse: false)` was called.');
+ }
+ }
+}
+
+/// Runs [computation] with a new [Arena], and releases all allocations at the
+/// end.
+///
+/// If the return value of [computation] is a [Future], all allocations are
+/// released when the future completes.
+///
+/// If the isolate is shut down, through `Isolate.kill()`, resources are _not_
+/// cleaned up.
+R using<R>(R Function(Arena) computation,
+ [Allocator wrappedAllocator = calloc]) {
+ final arena = Arena(wrappedAllocator);
+ bool isAsync = false;
+ try {
+ final result = computation(arena);
+ if (result is Future) {
+ isAsync = true;
+ return (result.whenComplete(arena.releaseAll) as R);
+ }
+ return result;
+ } finally {
+ if (!isAsync) {
+ arena.releaseAll();
+ }
+ }
+}
+
+/// Creates a zoned [Arena] to manage native resources.
+///
+/// The arena is availabe through [zoneArena].
+///
+/// If the isolate is shut down, through `Isolate.kill()`, resources are _not_ cleaned up.
+R withZoneArena<R>(R Function() computation,
+ [Allocator wrappedAllocator = calloc]) {
+ final arena = Arena(wrappedAllocator);
+ var arenaHolder = [arena];
+ bool isAsync = false;
+ try {
+ return runZoned(() {
+ final result = computation();
+ if (result is Future) {
+ isAsync = true;
+ result.whenComplete(arena.releaseAll);
+ }
+ return result;
+ }, zoneValues: {#_arena: arenaHolder});
+ } finally {
+ if (!isAsync) {
+ arena.releaseAll();
+ arenaHolder.clear();
+ }
+ }
+}
+
+/// A zone-specific [Arena].
+///
+/// Asynchronous computations can share a [Arena]. Use [withZoneArena] to create
+/// a new zone with a fresh [Arena], and that arena will then be released
+/// automatically when the function passed to [withZoneArena] completes.
+/// All code inside that zone can use `zoneArena` to access the arena.
+///
+/// The current arena must not be accessed by code which is not running inside
+/// a zone created by [withZoneArena].
+Arena get zoneArena {
+ final List<Arena>? arenaHolder = Zone.current[#_arena];
+ if (arenaHolder == null) {
+ throw StateError('Not inside a zone created by `useArena`');
+ }
+ if (arenaHolder.isNotEmpty) {
+ return arenaHolder.single;
+ }
+ throw StateError('Arena has already been cleared with releaseAll.');
+}
diff --git a/samples/ffi/resource_management/pool_isolate_shutdown_sample.dart b/samples/ffi/resource_management/arena_isolate_shutdown_sample.dart
similarity index 95%
rename from samples/ffi/resource_management/pool_isolate_shutdown_sample.dart
rename to samples/ffi/resource_management/arena_isolate_shutdown_sample.dart
index 39de01d..52ec773 100644
--- a/samples/ffi/resource_management/pool_isolate_shutdown_sample.dart
+++ b/samples/ffi/resource_management/arena_isolate_shutdown_sample.dart
@@ -10,7 +10,7 @@
import 'package:expect/expect.dart';
-import 'pool.dart';
+import 'arena.dart';
import '../dylib_utils.dart';
void main() {
@@ -50,9 +50,9 @@
const keepHelperIsolateAlive = true;
void helperIsolateMain(SendPort sendToMain) {
- using((Pool pool) {
- final resource = pool.using(allocateResource(), releaseResource);
- pool.onReleaseAll(() {
+ using((Arena arena) {
+ final resource = arena.using(allocateResource(), releaseResource);
+ arena.onReleaseAll(() {
// Will only run print if [keepHelperIsolateAlive] is false.
print("Helper: Releasing all resources.");
});
diff --git a/samples/ffi/resource_management/pool_sample.dart b/samples/ffi/resource_management/arena_sample.dart
similarity index 77%
rename from samples/ffi/resource_management/pool_sample.dart
rename to samples/ffi/resource_management/arena_sample.dart
index 1f75165..a12b553 100644
--- a/samples/ffi/resource_management/pool_sample.dart
+++ b/samples/ffi/resource_management/arena_sample.dart
@@ -2,14 +2,14 @@
// 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.
//
-// Sample illustrating resource management with an explicit pool.
+// Sample illustrating resource management with an explicit arena.
import 'dart:async';
import 'dart:ffi';
import 'package:expect/expect.dart';
-import 'pool.dart';
+import 'arena.dart';
import 'utf8_helpers.dart';
import '../dylib_utils.dart';
@@ -22,8 +22,8 @@
void Function(Pointer<Void>, Pointer<Void>, int)>("MemMove");
// To ensure resources are freed, wrap them in a [using] call.
- using((Pool pool) {
- final p = pool<Int64>(2);
+ using((Arena arena) {
+ final p = arena<Int64>(2);
p[0] = 24;
MemMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), sizeOf<Int64>());
print(p[1]);
@@ -32,8 +32,8 @@
// Resources are freed also when abnormal control flow occurs.
try {
- using((Pool pool) {
- final p = pool<Int64>(2);
+ using((Arena arena) {
+ final p = arena<Int64>(2);
p[0] = 25;
MemMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), 8);
print(p[1]);
@@ -45,11 +45,11 @@
print("Caught exception: $e");
}
- // In a pool multiple resources can be allocated, which will all be freed
+ // In a arena multiple resources can be allocated, which will all be freed
// at the end of the scope.
- using((Pool pool) {
- final p = pool<Int64>(2);
- final p2 = pool<Int64>(2);
+ using((Arena arena) {
+ final p = arena<Int64>(2);
+ final p2 = arena<Int64>(2);
p[0] = 1;
p[1] = 2;
MemMove(p2.cast<Void>(), p.cast<Void>(), 2 * sizeOf<Int64>());
@@ -58,14 +58,14 @@
});
// If the resource allocation happens in a different scope, then one either
- // needs to pass the pool to that scope.
- f1(Pool pool) {
- return pool<Int64>(2);
+ // needs to pass the arena to that scope.
+ f1(Arena arena) {
+ return arena<Int64>(2);
}
- using((Pool pool) {
- final p = f1(pool);
- final p2 = f1(pool);
+ using((Arena arena) {
+ final p = f1(arena);
+ final p2 = f1(arena);
p[0] = 1;
p[1] = 2;
MemMove(p2.cast<Void>(), p.cast<Void>(), 2 * sizeOf<Int64>());
@@ -74,8 +74,8 @@
});
// Using Strings.
- using((Pool pool) {
- final p = "Hello world!".toUtf8(pool);
+ using((Arena arena) {
+ final p = "Hello world!".toUtf8(arena);
print(p.contents());
});
@@ -92,15 +92,15 @@
void Function(Pointer<SomeResource>)>("ReleaseResource");
// Using an FFI call to release a resource.
- using((Pool pool) {
- final r = pool.using(allocateResource(), releaseResource);
+ using((Arena arena) {
+ final r = arena.using(allocateResource(), releaseResource);
useResource(r);
});
// Using an FFI call to release a resource with abnormal control flow.
try {
- using((Pool pool) {
- final r = pool.using(allocateResource(), releaseResource);
+ using((Arena arena) {
+ final r = arena.using(allocateResource(), releaseResource);
useResource(r);
throw Exception("Some random exception");
@@ -117,9 +117,9 @@
freed.add(i);
}
- Future<int> myFutureInt = using((Pool pool) {
+ Future<int> myFutureInt = using((Arena arena) {
return Future.microtask(() {
- pool.using(1, freeInt);
+ arena.using(1, freeInt);
return 1;
});
});
diff --git a/samples/ffi/resource_management/arena_test.dart b/samples/ffi/resource_management/arena_test.dart
new file mode 100644
index 0000000..18ffaa9
--- /dev/null
+++ b/samples/ffi/resource_management/arena_test.dart
@@ -0,0 +1,208 @@
+// Copyright (c) 2021, 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 'dart:async';
+import 'dart:ffi';
+
+import 'package:ffi/ffi.dart';
+import 'package:test/test.dart';
+
+// TODO(dacoharkes): After merging into `package:ffi`, roll package in DEPS
+// and remove arena.dart.
+import 'arena.dart';
+
+void main() async {
+ test('sync', () async {
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ using((Arena arena) {
+ arena.using(1234, freeInt);
+ expect(freed.isEmpty, true);
+ });
+ expect(freed, [1234]);
+ });
+
+ test('async', () async {
+ /// Calling [using] waits with releasing its resources until after
+ /// [Future]s complete.
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ Future<int> myFutureInt = using((Arena arena) {
+ return Future.microtask(() {
+ arena.using(1234, freeInt);
+ return 1;
+ });
+ });
+
+ expect(freed.isEmpty, true);
+ await myFutureInt;
+ expect(freed, [1234]);
+ });
+
+ test('throw', () {
+ /// [using] waits with releasing its resources until after [Future]s
+ /// complete.
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ // Resources are freed also when abnormal control flow occurs.
+ var didThrow = false;
+ try {
+ using((Arena arena) {
+ arena.using(1234, freeInt);
+ expect(freed.isEmpty, true);
+ throw Exception('Exception 1');
+ });
+ } on Exception {
+ expect(freed.single, 1234);
+ didThrow = true;
+ }
+ expect(didThrow, true);
+ });
+
+ test(
+ 'allocate',
+ () {
+ final countingAllocator = CountingAllocator();
+ // To ensure resources are freed, wrap them in a [using] call.
+ using((Arena arena) {
+ final p = arena<Int64>(2);
+ p[1] = p[0];
+ }, countingAllocator);
+ expect(countingAllocator.freeCount, 1);
+ },
+ );
+
+ test('allocate throw', () {
+ // Resources are freed also when abnormal control flow occurs.
+ bool didThrow = false;
+ final countingAllocator = CountingAllocator();
+ try {
+ using((Arena arena) {
+ final p = arena<Int64>(2);
+ p[0] = 25;
+ throw Exception('Exception 2');
+ }, countingAllocator);
+ } on Exception {
+ expect(countingAllocator.freeCount, 1);
+ didThrow = true;
+ }
+ expect(didThrow, true);
+ });
+
+ test('toNativeUtf8', () {
+ final countingAllocator = CountingAllocator();
+ using((Arena arena) {
+ final p = 'Hello world!'.toNativeUtf8(allocator: arena);
+ expect(p.toDartString(), 'Hello world!');
+ }, countingAllocator);
+ expect(countingAllocator.freeCount, 1);
+ });
+
+ test('zone', () async {
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ withZoneArena(() {
+ zoneArena.using(1234, freeInt);
+ expect(freed.isEmpty, true);
+ });
+ expect(freed.length, 1);
+ expect(freed.single, 1234);
+ });
+
+ test('zone async', () async {
+ /// [using] waits with releasing its resources until after [Future]s
+ /// complete.
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ Future<int> myFutureInt = withZoneArena(() {
+ return Future.microtask(() {
+ zoneArena.using(1234, freeInt);
+ return 1;
+ });
+ });
+
+ expect(freed.isEmpty, true);
+ await myFutureInt;
+ expect(freed.length, 1);
+ expect(freed.single, 1234);
+ });
+
+ test('zone throw', () {
+ /// [using] waits with releasing its resources until after [Future]s
+ /// complete.
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ // Resources are freed also when abnormal control flow occurs.
+ bool didThrow = false;
+ try {
+ withZoneArena(() {
+ zoneArena.using(1234, freeInt);
+ expect(freed.isEmpty, true);
+ throw Exception('Exception 3');
+ });
+ } on Exception {
+ expect(freed.single, 1234);
+ didThrow = true;
+ }
+ expect(didThrow, true);
+ expect(freed.single, 1234);
+ });
+
+ test('allocate during releaseAll', () {
+ final countingAllocator = CountingAllocator();
+ final arena = Arena(countingAllocator);
+
+ arena.using(arena<Uint8>(), (Pointer discard) {
+ arena<Uint8>();
+ });
+
+ expect(countingAllocator.allocationCount, 1);
+ expect(countingAllocator.freeCount, 0);
+
+ arena.releaseAll(reuse: true);
+
+ expect(countingAllocator.allocationCount, 2);
+ expect(countingAllocator.freeCount, 2);
+ });
+}
+
+/// Keeps track of the number of allocates and frees for testing purposes.
+class CountingAllocator implements Allocator {
+ final Allocator wrappedAllocator;
+
+ int allocationCount = 0;
+ int freeCount = 0;
+
+ CountingAllocator([this.wrappedAllocator = calloc]);
+
+ @override
+ Pointer<T> allocate<T extends NativeType>(int byteCount, {int? alignment}) {
+ allocationCount++;
+ return wrappedAllocator.allocate(byteCount, alignment: alignment);
+ }
+
+ @override
+ void free(Pointer<NativeType> pointer) {
+ freeCount++;
+ return wrappedAllocator.free(pointer);
+ }
+}
diff --git a/samples/ffi/resource_management/pool_zoned_sample.dart b/samples/ffi/resource_management/arena_zoned_sample.dart
similarity index 77%
rename from samples/ffi/resource_management/pool_zoned_sample.dart
rename to samples/ffi/resource_management/arena_zoned_sample.dart
index b5b9eed..bb1defa 100644
--- a/samples/ffi/resource_management/pool_zoned_sample.dart
+++ b/samples/ffi/resource_management/arena_zoned_sample.dart
@@ -2,13 +2,13 @@
// 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.
//
-// Sample illustrating resource management with an implicit pool in the zone.
+// Sample illustrating resource management with an implicit arena in the zone.
import 'dart:ffi';
import 'package:expect/expect.dart';
-import 'pool.dart';
+import 'arena.dart';
import 'utf8_helpers.dart';
import '../dylib_utils.dart';
@@ -20,9 +20,9 @@
Void Function(Pointer<Void>, Pointer<Void>, IntPtr),
void Function(Pointer<Void>, Pointer<Void>, int)>("MemMove");
- // To ensure resources are freed, wrap them in a [withZonePool] call.
- withZonePool(() {
- final p = zonePool<Int64>(2);
+ // To ensure resources are freed, wrap them in a [withZoneArena] call.
+ withZoneArena(() {
+ final p = zoneArena<Int64>(2);
p[0] = 24;
MemMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), sizeOf<Int64>());
print(p[1]);
@@ -31,8 +31,8 @@
// Resources are freed also when abnormal control flow occurs.
try {
- withZonePool(() {
- final p = zonePool<Int64>(2);
+ withZoneArena(() {
+ final p = zoneArena<Int64>(2);
p[0] = 25;
MemMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), 8);
print(p[1]);
@@ -43,11 +43,11 @@
print("Caught exception: ${e}");
}
- // In a pool multiple resources can be allocated, which will all be freed
+ // In a arena multiple resources can be allocated, which will all be freed
// at the end of the scope.
- withZonePool(() {
- final p = zonePool<Int64>(2);
- final p2 = zonePool<Int64>(2);
+ withZoneArena(() {
+ final p = zoneArena<Int64>(2);
+ final p2 = zoneArena<Int64>(2);
p[0] = 1;
p[1] = 2;
MemMove(p2.cast<Void>(), p.cast<Void>(), 2 * sizeOf<Int64>());
@@ -56,12 +56,12 @@
});
// If the resource allocation happens in a different scope, it is in the
- // same zone, so it's lifetime is automatically managed by the pool.
+ // same zone, so it's lifetime is automatically managed by the arena.
f1() {
- return zonePool<Int64>(2);
+ return zoneArena<Int64>(2);
}
- withZonePool(() {
+ withZoneArena(() {
final p = f1();
final p2 = f1();
p[0] = 1;
@@ -72,8 +72,8 @@
});
// Using Strings.
- withZonePool(() {
- final p = "Hello world!".toUtf8(zonePool);
+ withZoneArena(() {
+ final p = "Hello world!".toUtf8(zoneArena);
print(p.contents());
});
@@ -90,15 +90,15 @@
void Function(Pointer<SomeResource>)>("ReleaseResource");
// Using an FFI call to release a resource.
- withZonePool(() {
- final r = zonePool.using(allocateResource(), releaseResource);
+ withZoneArena(() {
+ final r = zoneArena.using(allocateResource(), releaseResource);
useResource(r);
});
// Using an FFI call to release a resource with abnormal control flow.
try {
- withZonePool(() {
- final r = zonePool.using(allocateResource(), releaseResource);
+ withZoneArena(() {
+ final r = zoneArena.using(allocateResource(), releaseResource);
useResource(r);
throw Exception("Some random exception");
@@ -116,9 +116,9 @@
freed.add(i);
}
- Future<int> myFutureInt = withZonePool(() {
+ Future<int> myFutureInt = withZoneArena(() {
return Future.microtask(() {
- zonePool.using(1, freeInt);
+ zoneArena.using(1, freeInt);
return 1;
});
});
diff --git a/samples/ffi/resource_management/pool.dart b/samples/ffi/resource_management/pool.dart
deleted file mode 100644
index e37fd22..0000000
--- a/samples/ffi/resource_management/pool.dart
+++ /dev/null
@@ -1,171 +0,0 @@
-// 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.
-//
-// Explicit pool used for managing resources.
-
-import "dart:async";
-import 'dart:ffi';
-
-import 'package:ffi/ffi.dart';
-
-/// An [Allocator] which frees all allocations at the same time.
-///
-/// The pool allows you to allocate heap memory, but ignores calls to [free].
-/// Instead you call [releaseAll] to release all the allocations at the same
-/// time.
-///
-/// Also allows other resources to be associated with the pool, through the
-/// [using] method, to have a release function called for them when the pool is
-/// released.
-///
-/// An [Allocator] can be provided to do the actual allocation and freeing.
-/// Defaults to using [calloc].
-class Pool implements Allocator {
- /// The [Allocator] used for allocation and freeing.
- final Allocator _wrappedAllocator;
-
- /// Native memory under management by this [Pool].
- final List<Pointer<NativeType>> _managedMemoryPointers = [];
-
- /// Callbacks for releasing native resources under management by this [Pool].
- final List<Function()> _managedResourceReleaseCallbacks = [];
-
- bool _inUse = true;
-
- /// Creates a pool of allocations.
- ///
- /// The [allocator] is used to do the actual allocation and freeing of
- /// memory. It defaults to using [calloc].
- Pool([Allocator allocator = calloc]) : _wrappedAllocator = allocator;
-
- /// Allocates memory and includes it in the pool.
- ///
- /// Uses the allocator provided to the [Pool] constructor to do the
- /// allocation.
- ///
- /// Throws an [ArgumentError] if the number of bytes or alignment cannot be
- /// satisfied.
- @override
- Pointer<T> allocate<T extends NativeType>(int byteCount, {int? alignment}) {
- _ensureInUse();
- final p = _wrappedAllocator.allocate<T>(byteCount, alignment: alignment);
- _managedMemoryPointers.add(p);
- return p;
- }
-
- /// Registers [resource] in this pool.
- ///
- /// Executes [releaseCallback] on [releaseAll].
- T using<T>(T resource, Function(T) releaseCallback) {
- _ensureInUse();
- releaseCallback = Zone.current.bindUnaryCallback(releaseCallback);
- _managedResourceReleaseCallbacks.add(() => releaseCallback(resource));
- return resource;
- }
-
- /// Registers [releaseResourceCallback] to be executed on [releaseAll].
- void onReleaseAll(Function() releaseResourceCallback) {
- _managedResourceReleaseCallbacks.add(releaseResourceCallback);
- }
-
- /// Releases all resources that this [Pool] manages.
- ///
- /// If [reuse] is `true`, the pool can be used again after resources
- /// have been released. If not, the default, then the [allocate]
- /// and [using] methods must not be called after a call to `releaseAll`.
- void releaseAll({bool reuse = false}) {
- if (!reuse) {
- _inUse = false;
- }
- while (_managedResourceReleaseCallbacks.isNotEmpty) {
- _managedResourceReleaseCallbacks.removeLast()();
- }
- for (final p in _managedMemoryPointers) {
- _wrappedAllocator.free(p);
- }
- _managedMemoryPointers.clear();
- }
-
- /// Does nothing, invoke [releaseAll] instead.
- @override
- void free(Pointer<NativeType> pointer) {}
-
- void _ensureInUse() {
- if (!_inUse) {
- throw StateError(
- "Pool no longer in use, `releaseAll(reuse: false)` was called.");
- }
- }
-}
-
-/// Runs [computation] with a new [Pool], and releases all allocations at the end.
-///
-/// If [R] is a [Future], all allocations are released when the future completes.
-///
-/// If the isolate is shut down, through `Isolate.kill()`, resources are _not_
-/// cleaned up.
-R using<R>(R Function(Pool) computation,
- [Allocator wrappedAllocator = calloc]) {
- final pool = Pool(wrappedAllocator);
- bool isAsync = false;
- try {
- final result = computation(pool);
- if (result is Future) {
- isAsync = true;
- return (result.whenComplete(pool.releaseAll) as R);
- }
- return result;
- } finally {
- if (!isAsync) {
- pool.releaseAll();
- }
- }
-}
-
-/// Creates a zoned [Pool] to manage native resources.
-///
-/// The pool is availabe through [zonePool].
-///
-/// If the isolate is shut down, through `Isolate.kill()`, resources are _not_ cleaned up.
-R withZonePool<R>(R Function() computation,
- [Allocator wrappedAllocator = calloc]) {
- final pool = Pool(wrappedAllocator);
- var poolHolder = [pool];
- bool isAsync = false;
- try {
- return runZoned(() {
- final result = computation();
- if (result is Future) {
- isAsync = true;
- result.whenComplete(pool.releaseAll);
- }
- return result;
- }, zoneValues: {#_pool: poolHolder});
- } finally {
- if (!isAsync) {
- pool.releaseAll();
- poolHolder.remove(pool);
- }
- }
-}
-
-/// A zone-specific [Pool].
-///
-/// Asynchronous computations can share a [Pool]. Use [withZonePool] to create
-/// a new zone with a fresh [Pool], and that pool will then be released
-/// automatically when the function passed to [withZonePool] completes.
-/// All code inside that zone can use `zonePool` to access the pool.
-///
-/// The current pool must not be accessed by code which is not running inside
-/// a zone created by [withZonePool].
-Pool get zonePool {
- final List<Pool>? poolHolder = Zone.current[#_pool];
- if (poolHolder == null) {
- throw StateError("Not inside a zone created by `usePool`");
- }
- if (!poolHolder.isEmpty) {
- return poolHolder.single;
- }
- throw StateError("Pool as already been cleared with releaseAll.");
-}
diff --git a/samples/ffi/resource_management/resource_management_test.dart b/samples/ffi/resource_management/resource_management_test.dart
index 1cc14f7..96fc129 100644
--- a/samples/ffi/resource_management/resource_management_test.dart
+++ b/samples/ffi/resource_management/resource_management_test.dart
@@ -6,14 +6,14 @@
//
// SharedObjects=ffi_test_dynamic_library ffi_test_functions
-import 'pool_isolate_shutdown_sample.dart' as pool_isolate;
-import 'pool_sample.dart' as pool;
-import 'pool_zoned_sample.dart' as pool_zoned;
+import 'arena_isolate_shutdown_sample.dart' as arena_isolate;
+import 'arena_sample.dart' as arena;
+import 'arena_zoned_sample.dart' as arena_zoned;
import 'unmanaged_sample.dart' as unmanaged;
main() {
- pool_isolate.main();
- pool.main();
- pool_zoned.main();
+ arena_isolate.main();
+ arena.main();
+ arena_zoned.main();
unmanaged.main();
}
diff --git a/samples/ffi/resource_management/unmanaged_sample.dart b/samples/ffi/resource_management/unmanaged_sample.dart
index 5ddb6ae..495564d 100644
--- a/samples/ffi/resource_management/unmanaged_sample.dart
+++ b/samples/ffi/resource_management/unmanaged_sample.dart
@@ -22,7 +22,7 @@
// To ensure resources are freed, call free manually.
//
- // For automatic management use a Pool.
+ // For automatic management use a Arena.
final p = calloc<Int64>(2);
p[0] = 24;
memMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), sizeOf<Int64>());
diff --git a/samples/ffi/resource_management/utf8_helpers.dart b/samples/ffi/resource_management/utf8_helpers.dart
index a27ccd6..4ef8a45 100644
--- a/samples/ffi/resource_management/utf8_helpers.dart
+++ b/samples/ffi/resource_management/utf8_helpers.dart
@@ -8,7 +8,7 @@
import 'package:ffi/ffi.dart';
-extension Utf8InPool on String {
+extension Utf8InArena on String {
/// Convert a [String] to a Utf8-encoded null-terminated C string.
///
/// If 'string' contains NULL bytes, the converted string will be truncated
diff --git a/samples_2/ffi/resource_management/arena.dart b/samples_2/ffi/resource_management/arena.dart
new file mode 100644
index 0000000..4916c3a
--- /dev/null
+++ b/samples_2/ffi/resource_management/arena.dart
@@ -0,0 +1,184 @@
+// 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.
+//
+// Explicit arena used for managing resources.
+
+// @dart = 2.9
+
+import 'dart:async';
+import 'dart:ffi';
+
+import 'package:ffi/ffi.dart';
+
+/// An [Allocator] which frees all allocations at the same time.
+///
+/// The arena allows you to allocate heap memory, but ignores calls to [free].
+/// Instead you call [releaseAll] to release all the allocations at the same
+/// time.
+///
+/// Also allows other resources to be associated with the arena, through the
+/// [using] method, to have a release function called for them when the arena is
+/// released.
+///
+/// An [Allocator] can be provided to do the actual allocation and freeing.
+/// Defaults to using [calloc].
+class Arena implements Allocator {
+ /// The [Allocator] used for allocation and freeing.
+ final Allocator _wrappedAllocator;
+
+ /// Native memory under management by this [Arena].
+ final List<Pointer<NativeType>> _managedMemoryPointers = [];
+
+ /// Callbacks for releasing native resources under management by this [Arena].
+ final List<void Function()> _managedResourceReleaseCallbacks = [];
+
+ bool _inUse = true;
+
+ /// Creates a arena of allocations.
+ ///
+ /// The [allocator] is used to do the actual allocation and freeing of
+ /// memory. It defaults to using [calloc].
+ Arena([Allocator allocator = calloc]) : _wrappedAllocator = allocator;
+
+ /// Allocates memory and includes it in the arena.
+ ///
+ /// Uses the allocator provided to the [Arena] constructor to do the
+ /// allocation.
+ ///
+ /// Throws an [ArgumentError] if the number of bytes or alignment cannot be
+ /// satisfied.
+ @override
+ Pointer<T> allocate<T extends NativeType>(int byteCount, {int alignment}) {
+ _ensureInUse();
+ final p = _wrappedAllocator.allocate<T>(byteCount, alignment: alignment);
+ _managedMemoryPointers.add(p);
+ return p;
+ }
+
+ /// Registers [resource] in this arena.
+ ///
+ /// Executes [releaseCallback] on [releaseAll].
+ ///
+ /// Returns [resource] again, to allow for easily inserting
+ /// `arena.using(resource, ...)` where the resource is allocated.
+ T using<T>(T resource, void Function(T) releaseCallback) {
+ _ensureInUse();
+ releaseCallback = Zone.current.bindUnaryCallback(releaseCallback);
+ _managedResourceReleaseCallbacks.add(() => releaseCallback(resource));
+ return resource;
+ }
+
+ /// Registers [releaseResourceCallback] to be executed on [releaseAll].
+ void onReleaseAll(void Function() releaseResourceCallback) {
+ _managedResourceReleaseCallbacks.add(releaseResourceCallback);
+ }
+
+ /// Releases all resources that this [Arena] manages.
+ ///
+ /// If [reuse] is `true`, the arena can be used again after resources
+ /// have been released. If not, the default, then the [allocate]
+ /// and [using] methods must not be called after a call to `releaseAll`.
+ ///
+ /// If any of the callbacks throw, [releaseAll] is interrupted, and should
+ /// be started again.
+ void releaseAll({bool reuse = false}) {
+ if (!reuse) {
+ _inUse = false;
+ }
+ // The code below is deliberately wirtten to allow allocations to happen
+ // during `releaseAll(reuse:true)`. The arena will still be guaranteed
+ // empty when the `releaseAll` call returns.
+ while (_managedResourceReleaseCallbacks.isNotEmpty) {
+ _managedResourceReleaseCallbacks.removeLast()();
+ }
+ for (final p in _managedMemoryPointers) {
+ _wrappedAllocator.free(p);
+ }
+ _managedMemoryPointers.clear();
+ }
+
+ /// Does nothing, invoke [releaseAll] instead.
+ @override
+ void free(Pointer<NativeType> pointer) {}
+
+ void _ensureInUse() {
+ if (!_inUse) {
+ throw StateError(
+ 'Arena no longer in use, `releaseAll(reuse: false)` was called.');
+ }
+ }
+}
+
+/// Runs [computation] with a new [Arena], and releases all allocations at the
+/// end.
+///
+/// If the return value of [computation] is a [Future], all allocations are
+/// released when the future completes.
+///
+/// If the isolate is shut down, through `Isolate.kill()`, resources are _not_
+/// cleaned up.
+R using<R>(R Function(Arena) computation,
+ [Allocator wrappedAllocator = calloc]) {
+ final arena = Arena(wrappedAllocator);
+ bool isAsync = false;
+ try {
+ final result = computation(arena);
+ if (result is Future) {
+ isAsync = true;
+ return (result.whenComplete(arena.releaseAll) as R);
+ }
+ return result;
+ } finally {
+ if (!isAsync) {
+ arena.releaseAll();
+ }
+ }
+}
+
+/// Creates a zoned [Arena] to manage native resources.
+///
+/// The arena is availabe through [zoneArena].
+///
+/// If the isolate is shut down, through `Isolate.kill()`, resources are _not_ cleaned up.
+R withZoneArena<R>(R Function() computation,
+ [Allocator wrappedAllocator = calloc]) {
+ final arena = Arena(wrappedAllocator);
+ var arenaHolder = [arena];
+ bool isAsync = false;
+ try {
+ return runZoned(() {
+ final result = computation();
+ if (result is Future) {
+ isAsync = true;
+ result.whenComplete(arena.releaseAll);
+ }
+ return result;
+ }, zoneValues: {#_arena: arenaHolder});
+ } finally {
+ if (!isAsync) {
+ arena.releaseAll();
+ arenaHolder.clear();
+ }
+ }
+}
+
+/// A zone-specific [Arena].
+///
+/// Asynchronous computations can share a [Arena]. Use [withZoneArena] to create
+/// a new zone with a fresh [Arena], and that arena will then be released
+/// automatically when the function passed to [withZoneArena] completes.
+/// All code inside that zone can use `zoneArena` to access the arena.
+///
+/// The current arena must not be accessed by code which is not running inside
+/// a zone created by [withZoneArena].
+Arena get zoneArena {
+ final List<Arena> arenaHolder = Zone.current[#_arena];
+ if (arenaHolder == null) {
+ throw StateError('Not inside a zone created by `useArena`');
+ }
+ if (arenaHolder.isNotEmpty) {
+ return arenaHolder.single;
+ }
+ throw StateError('Arena has already been cleared with releaseAll.');
+}
diff --git a/samples_2/ffi/resource_management/pool_isolate_shutdown_sample.dart b/samples_2/ffi/resource_management/arena_isolate_shutdown_sample.dart
similarity index 95%
rename from samples_2/ffi/resource_management/pool_isolate_shutdown_sample.dart
rename to samples_2/ffi/resource_management/arena_isolate_shutdown_sample.dart
index 4c8eb0f..8d1e5c7 100644
--- a/samples_2/ffi/resource_management/pool_isolate_shutdown_sample.dart
+++ b/samples_2/ffi/resource_management/arena_isolate_shutdown_sample.dart
@@ -12,7 +12,7 @@
import 'package:expect/expect.dart';
-import 'pool.dart';
+import 'arena.dart';
import '../dylib_utils.dart';
void main() {
@@ -52,9 +52,9 @@
const keepHelperIsolateAlive = true;
void helperIsolateMain(SendPort sendToMain) {
- using((Pool pool) {
- final resource = pool.using(allocateResource(), releaseResource);
- pool.onReleaseAll(() {
+ using((Arena arena) {
+ final resource = arena.using(allocateResource(), releaseResource);
+ arena.onReleaseAll(() {
// Will only run print if [keepHelperIsolateAlive] is false.
print("Helper: Releasing all resources.");
});
diff --git a/samples_2/ffi/resource_management/pool_sample.dart b/samples_2/ffi/resource_management/arena_sample.dart
similarity index 77%
rename from samples_2/ffi/resource_management/pool_sample.dart
rename to samples_2/ffi/resource_management/arena_sample.dart
index e3441c1..d8cbe80 100644
--- a/samples_2/ffi/resource_management/pool_sample.dart
+++ b/samples_2/ffi/resource_management/arena_sample.dart
@@ -2,7 +2,7 @@
// 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.
//
-// Sample illustrating resource management with an explicit pool.
+// Sample illustrating resource management with an explicit arena.
// @dart = 2.9
@@ -10,7 +10,7 @@
import 'package:expect/expect.dart';
-import 'pool.dart';
+import 'arena.dart';
import 'utf8_helpers.dart';
import '../dylib_utils.dart';
@@ -23,8 +23,8 @@
void Function(Pointer<Void>, Pointer<Void>, int)>("MemMove");
// To ensure resources are freed, wrap them in a [using] call.
- using((Pool pool) {
- final p = pool<Int64>(2);
+ using((Arena arena) {
+ final p = arena<Int64>(2);
p[0] = 24;
MemMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), sizeOf<Int64>());
print(p[1]);
@@ -33,8 +33,8 @@
// Resources are freed also when abnormal control flow occurs.
try {
- using((Pool pool) {
- final p = pool<Int64>(2);
+ using((Arena arena) {
+ final p = arena<Int64>(2);
p[0] = 25;
MemMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), 8);
print(p[1]);
@@ -46,11 +46,11 @@
print("Caught exception: $e");
}
- // In a pool multiple resources can be allocated, which will all be freed
+ // In a arena multiple resources can be allocated, which will all be freed
// at the end of the scope.
- using((Pool pool) {
- final p = pool<Int64>(2);
- final p2 = pool<Int64>(2);
+ using((Arena arena) {
+ final p = arena<Int64>(2);
+ final p2 = arena<Int64>(2);
p[0] = 1;
p[1] = 2;
MemMove(p2.cast<Void>(), p.cast<Void>(), 2 * sizeOf<Int64>());
@@ -59,14 +59,14 @@
});
// If the resource allocation happens in a different scope, then one either
- // needs to pass the pool to that scope.
- f1(Pool pool) {
- return pool<Int64>(2);
+ // needs to pass the arena to that scope.
+ f1(Arena arena) {
+ return arena<Int64>(2);
}
- using((Pool pool) {
- final p = f1(pool);
- final p2 = f1(pool);
+ using((Arena arena) {
+ final p = f1(arena);
+ final p2 = f1(arena);
p[0] = 1;
p[1] = 2;
MemMove(p2.cast<Void>(), p.cast<Void>(), 2 * sizeOf<Int64>());
@@ -75,8 +75,8 @@
});
// Using Strings.
- using((Pool pool) {
- final p = "Hello world!".toUtf8(pool);
+ using((Arena arena) {
+ final p = "Hello world!".toUtf8(arena);
print(p.contents());
});
@@ -93,15 +93,15 @@
void Function(Pointer<SomeResource>)>("ReleaseResource");
// Using an FFI call to release a resource.
- using((Pool pool) {
- final r = pool.using(allocateResource(), releaseResource);
+ using((Arena arena) {
+ final r = arena.using(allocateResource(), releaseResource);
useResource(r);
});
// Using an FFI call to release a resource with abnormal control flow.
try {
- using((Pool pool) {
- final r = pool.using(allocateResource(), releaseResource);
+ using((Arena arena) {
+ final r = arena.using(allocateResource(), releaseResource);
useResource(r);
throw Exception("Some random exception");
@@ -118,9 +118,9 @@
freed.add(i);
}
- Future<int> myFutureInt = using((Pool pool) {
+ Future<int> myFutureInt = using((Arena arena) {
return Future.microtask(() {
- pool.using(1, freeInt);
+ arena.using(1, freeInt);
return 1;
});
});
diff --git a/samples_2/ffi/resource_management/arena_test.dart b/samples_2/ffi/resource_management/arena_test.dart
new file mode 100644
index 0000000..699d94b
--- /dev/null
+++ b/samples_2/ffi/resource_management/arena_test.dart
@@ -0,0 +1,210 @@
+// Copyright (c) 2021, 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.
+//
+// @dart = 2.9
+
+import 'dart:async';
+import 'dart:ffi';
+
+import 'package:ffi/ffi.dart';
+import 'package:test/test.dart';
+
+// TODO(dacoharkes): After merging into `package:ffi`, roll package in DEPS
+// and remove arena.dart.
+import 'arena.dart';
+
+void main() async {
+ test('sync', () async {
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ using((Arena arena) {
+ arena.using(1234, freeInt);
+ expect(freed.isEmpty, true);
+ });
+ expect(freed, [1234]);
+ });
+
+ test('async', () async {
+ /// Calling [using] waits with releasing its resources until after
+ /// [Future]s complete.
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ Future<int> myFutureInt = using((Arena arena) {
+ return Future.microtask(() {
+ arena.using(1234, freeInt);
+ return 1;
+ });
+ });
+
+ expect(freed.isEmpty, true);
+ await myFutureInt;
+ expect(freed, [1234]);
+ });
+
+ test('throw', () {
+ /// [using] waits with releasing its resources until after [Future]s
+ /// complete.
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ // Resources are freed also when abnormal control flow occurs.
+ var didThrow = false;
+ try {
+ using((Arena arena) {
+ arena.using(1234, freeInt);
+ expect(freed.isEmpty, true);
+ throw Exception('Exception 1');
+ });
+ } on Exception {
+ expect(freed.single, 1234);
+ didThrow = true;
+ }
+ expect(didThrow, true);
+ });
+
+ test(
+ 'allocate',
+ () {
+ final countingAllocator = CountingAllocator();
+ // To ensure resources are freed, wrap them in a [using] call.
+ using((Arena arena) {
+ final p = arena<Int64>(2);
+ p[1] = p[0];
+ }, countingAllocator);
+ expect(countingAllocator.freeCount, 1);
+ },
+ );
+
+ test('allocate throw', () {
+ // Resources are freed also when abnormal control flow occurs.
+ bool didThrow = false;
+ final countingAllocator = CountingAllocator();
+ try {
+ using((Arena arena) {
+ final p = arena<Int64>(2);
+ p[0] = 25;
+ throw Exception('Exception 2');
+ }, countingAllocator);
+ } on Exception {
+ expect(countingAllocator.freeCount, 1);
+ didThrow = true;
+ }
+ expect(didThrow, true);
+ });
+
+ test('toNativeUtf8', () {
+ final countingAllocator = CountingAllocator();
+ using((Arena arena) {
+ final p = 'Hello world!'.toNativeUtf8(allocator: arena);
+ expect(p.toDartString(), 'Hello world!');
+ }, countingAllocator);
+ expect(countingAllocator.freeCount, 1);
+ });
+
+ test('zone', () async {
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ withZoneArena(() {
+ zoneArena.using(1234, freeInt);
+ expect(freed.isEmpty, true);
+ });
+ expect(freed.length, 1);
+ expect(freed.single, 1234);
+ });
+
+ test('zone async', () async {
+ /// [using] waits with releasing its resources until after [Future]s
+ /// complete.
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ Future<int> myFutureInt = withZoneArena(() {
+ return Future.microtask(() {
+ zoneArena.using(1234, freeInt);
+ return 1;
+ });
+ });
+
+ expect(freed.isEmpty, true);
+ await myFutureInt;
+ expect(freed.length, 1);
+ expect(freed.single, 1234);
+ });
+
+ test('zone throw', () {
+ /// [using] waits with releasing its resources until after [Future]s
+ /// complete.
+ List<int> freed = [];
+ void freeInt(int i) {
+ freed.add(i);
+ }
+
+ // Resources are freed also when abnormal control flow occurs.
+ bool didThrow = false;
+ try {
+ withZoneArena(() {
+ zoneArena.using(1234, freeInt);
+ expect(freed.isEmpty, true);
+ throw Exception('Exception 3');
+ });
+ } on Exception {
+ expect(freed.single, 1234);
+ didThrow = true;
+ }
+ expect(didThrow, true);
+ expect(freed.single, 1234);
+ });
+
+ test('allocate during releaseAll', () {
+ final countingAllocator = CountingAllocator();
+ final arena = Arena(countingAllocator);
+
+ arena.using(arena<Uint8>(), (Pointer discard) {
+ arena<Uint8>();
+ });
+
+ expect(countingAllocator.allocationCount, 1);
+ expect(countingAllocator.freeCount, 0);
+
+ arena.releaseAll(reuse: true);
+
+ expect(countingAllocator.allocationCount, 2);
+ expect(countingAllocator.freeCount, 2);
+ });
+}
+
+/// Keeps track of the number of allocates and frees for testing purposes.
+class CountingAllocator implements Allocator {
+ final Allocator wrappedAllocator;
+
+ int allocationCount = 0;
+ int freeCount = 0;
+
+ CountingAllocator([this.wrappedAllocator = calloc]);
+
+ @override
+ Pointer<T> allocate<T extends NativeType>(int byteCount, {int alignment}) {
+ allocationCount++;
+ return wrappedAllocator.allocate(byteCount, alignment: alignment);
+ }
+
+ @override
+ void free(Pointer<NativeType> pointer) {
+ freeCount++;
+ return wrappedAllocator.free(pointer);
+ }
+}
diff --git a/samples_2/ffi/resource_management/pool_zoned_sample.dart b/samples_2/ffi/resource_management/arena_zoned_sample.dart
similarity index 77%
rename from samples_2/ffi/resource_management/pool_zoned_sample.dart
rename to samples_2/ffi/resource_management/arena_zoned_sample.dart
index b9142c2..a22e279 100644
--- a/samples_2/ffi/resource_management/pool_zoned_sample.dart
+++ b/samples_2/ffi/resource_management/arena_zoned_sample.dart
@@ -2,7 +2,7 @@
// 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.
//
-// Sample illustrating resource management with an implicit pool in the zone.
+// Sample illustrating resource management with an implicit arena in the zone.
// @dart = 2.9
@@ -10,7 +10,7 @@
import 'package:expect/expect.dart';
-import 'pool.dart';
+import 'arena.dart';
import 'utf8_helpers.dart';
import '../dylib_utils.dart';
@@ -22,9 +22,9 @@
Void Function(Pointer<Void>, Pointer<Void>, IntPtr),
void Function(Pointer<Void>, Pointer<Void>, int)>("MemMove");
- // To ensure resources are freed, wrap them in a [withZonePool] call.
- withZonePool(() {
- final p = zonePool<Int64>(2);
+ // To ensure resources are freed, wrap them in a [withZoneArena] call.
+ withZoneArena(() {
+ final p = zoneArena<Int64>(2);
p[0] = 24;
MemMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), sizeOf<Int64>());
print(p[1]);
@@ -33,8 +33,8 @@
// Resources are freed also when abnormal control flow occurs.
try {
- withZonePool(() {
- final p = zonePool<Int64>(2);
+ withZoneArena(() {
+ final p = zoneArena<Int64>(2);
p[0] = 25;
MemMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), 8);
print(p[1]);
@@ -45,11 +45,11 @@
print("Caught exception: ${e}");
}
- // In a pool multiple resources can be allocated, which will all be freed
+ // In a arena multiple resources can be allocated, which will all be freed
// at the end of the scope.
- withZonePool(() {
- final p = zonePool<Int64>(2);
- final p2 = zonePool<Int64>(2);
+ withZoneArena(() {
+ final p = zoneArena<Int64>(2);
+ final p2 = zoneArena<Int64>(2);
p[0] = 1;
p[1] = 2;
MemMove(p2.cast<Void>(), p.cast<Void>(), 2 * sizeOf<Int64>());
@@ -58,12 +58,12 @@
});
// If the resource allocation happens in a different scope, it is in the
- // same zone, so it's lifetime is automatically managed by the pool.
+ // same zone, so it's lifetime is automatically managed by the arena.
f1() {
- return zonePool<Int64>(2);
+ return zoneArena<Int64>(2);
}
- withZonePool(() {
+ withZoneArena(() {
final p = f1();
final p2 = f1();
p[0] = 1;
@@ -74,8 +74,8 @@
});
// Using Strings.
- withZonePool(() {
- final p = "Hello world!".toUtf8(zonePool);
+ withZoneArena(() {
+ final p = "Hello world!".toUtf8(zoneArena);
print(p.contents());
});
@@ -92,15 +92,15 @@
void Function(Pointer<SomeResource>)>("ReleaseResource");
// Using an FFI call to release a resource.
- withZonePool(() {
- final r = zonePool.using(allocateResource(), releaseResource);
+ withZoneArena(() {
+ final r = zoneArena.using(allocateResource(), releaseResource);
useResource(r);
});
// Using an FFI call to release a resource with abnormal control flow.
try {
- withZonePool(() {
- final r = zonePool.using(allocateResource(), releaseResource);
+ withZoneArena(() {
+ final r = zoneArena.using(allocateResource(), releaseResource);
useResource(r);
throw Exception("Some random exception");
@@ -118,9 +118,9 @@
freed.add(i);
}
- Future<int> myFutureInt = withZonePool(() {
+ Future<int> myFutureInt = withZoneArena(() {
return Future.microtask(() {
- zonePool.using(1, freeInt);
+ zoneArena.using(1, freeInt);
return 1;
});
});
diff --git a/samples_2/ffi/resource_management/pool.dart b/samples_2/ffi/resource_management/pool.dart
deleted file mode 100644
index ddb5026..0000000
--- a/samples_2/ffi/resource_management/pool.dart
+++ /dev/null
@@ -1,173 +0,0 @@
-// 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.
-//
-// Explicit pool used for managing resources.
-
-// @dart = 2.9
-
-import "dart:async";
-import 'dart:ffi';
-
-import 'package:ffi/ffi.dart';
-
-/// An [Allocator] which frees all allocations at the same time.
-///
-/// The pool allows you to allocate heap memory, but ignores calls to [free].
-/// Instead you call [releaseAll] to release all the allocations at the same
-/// time.
-///
-/// Also allows other resources to be associated with the pool, through the
-/// [using] method, to have a release function called for them when the pool is
-/// released.
-///
-/// An [Allocator] can be provided to do the actual allocation and freeing.
-/// Defaults to using [calloc].
-class Pool implements Allocator {
- /// The [Allocator] used for allocation and freeing.
- final Allocator _wrappedAllocator;
-
- /// Native memory under management by this [Pool].
- final List<Pointer<NativeType>> _managedMemoryPointers = [];
-
- /// Callbacks for releasing native resources under management by this [Pool].
- final List<Function()> _managedResourceReleaseCallbacks = [];
-
- bool _inUse = true;
-
- /// Creates a pool of allocations.
- ///
- /// The [allocator] is used to do the actual allocation and freeing of
- /// memory. It defaults to using [calloc].
- Pool([Allocator allocator = calloc]) : _wrappedAllocator = allocator;
-
- /// Allocates memory and includes it in the pool.
- ///
- /// Uses the allocator provided to the [Pool] constructor to do the
- /// allocation.
- ///
- /// Throws an [ArgumentError] if the number of bytes or alignment cannot be
- /// satisfied.
- @override
- Pointer<T> allocate<T extends NativeType>(int byteCount, {int alignment}) {
- _ensureInUse();
- final p = _wrappedAllocator.allocate<T>(byteCount, alignment: alignment);
- _managedMemoryPointers.add(p);
- return p;
- }
-
- /// Registers [resource] in this pool.
- ///
- /// Executes [releaseCallback] on [releaseAll].
- T using<T>(T resource, Function(T) releaseCallback) {
- _ensureInUse();
- releaseCallback = Zone.current.bindUnaryCallback(releaseCallback);
- _managedResourceReleaseCallbacks.add(() => releaseCallback(resource));
- return resource;
- }
-
- /// Registers [releaseResourceCallback] to be executed on [releaseAll].
- void onReleaseAll(Function() releaseResourceCallback) {
- _managedResourceReleaseCallbacks.add(releaseResourceCallback);
- }
-
- /// Releases all resources that this [Pool] manages.
- ///
- /// If [reuse] is `true`, the pool can be used again after resources
- /// have been released. If not, the default, then the [allocate]
- /// and [using] methods must not be called after a call to `releaseAll`.
- void releaseAll({bool reuse = false}) {
- if (!reuse) {
- _inUse = false;
- }
- while (_managedResourceReleaseCallbacks.isNotEmpty) {
- _managedResourceReleaseCallbacks.removeLast()();
- }
- for (final p in _managedMemoryPointers) {
- _wrappedAllocator.free(p);
- }
- _managedMemoryPointers.clear();
- }
-
- /// Does nothing, invoke [releaseAll] instead.
- @override
- void free(Pointer<NativeType> pointer) {}
-
- void _ensureInUse() {
- if (!_inUse) {
- throw StateError(
- "Pool no longer in use, `releaseAll(reuse: false)` was called.");
- }
- }
-}
-
-/// Runs [computation] with a new [Pool], and releases all allocations at the end.
-///
-/// If [R] is a [Future], all allocations are released when the future completes.
-///
-/// If the isolate is shut down, through `Isolate.kill()`, resources are _not_
-/// cleaned up.
-R using<R>(R Function(Pool) computation,
- [Allocator wrappedAllocator = calloc]) {
- final pool = Pool(wrappedAllocator);
- bool isAsync = false;
- try {
- final result = computation(pool);
- if (result is Future) {
- isAsync = true;
- return (result.whenComplete(pool.releaseAll) as R);
- }
- return result;
- } finally {
- if (!isAsync) {
- pool.releaseAll();
- }
- }
-}
-
-/// Creates a zoned [Pool] to manage native resources.
-///
-/// The pool is availabe through [zonePool].
-///
-/// If the isolate is shut down, through `Isolate.kill()`, resources are _not_ cleaned up.
-R withZonePool<R>(R Function() computation,
- [Allocator wrappedAllocator = calloc]) {
- final pool = Pool(wrappedAllocator);
- var poolHolder = [pool];
- bool isAsync = false;
- try {
- return runZoned(() {
- final result = computation();
- if (result is Future) {
- isAsync = true;
- result.whenComplete(pool.releaseAll);
- }
- return result;
- }, zoneValues: {#_pool: poolHolder});
- } finally {
- if (!isAsync) {
- pool.releaseAll();
- poolHolder.remove(pool);
- }
- }
-}
-
-/// A zone-specific [Pool].
-///
-/// Asynchronous computations can share a [Pool]. Use [withZonePool] to create
-/// a new zone with a fresh [Pool], and that pool will then be released
-/// automatically when the function passed to [withZonePool] completes.
-/// All code inside that zone can use `zonePool` to access the pool.
-///
-/// The current pool must not be accessed by code which is not running inside
-/// a zone created by [withZonePool].
-Pool get zonePool {
- final List<Pool> poolHolder = Zone.current[#_pool];
- if (poolHolder == null) {
- throw StateError("Not inside a zone created by `usePool`");
- }
- if (!poolHolder.isEmpty) {
- return poolHolder.single;
- }
- throw StateError("Pool as already been cleared with releaseAll.");
-}
diff --git a/samples_2/ffi/resource_management/resource_management_test.dart b/samples_2/ffi/resource_management/resource_management_test.dart
index 4b2bbb0..6c596dd 100644
--- a/samples_2/ffi/resource_management/resource_management_test.dart
+++ b/samples_2/ffi/resource_management/resource_management_test.dart
@@ -8,14 +8,14 @@
// @dart = 2.9
-import 'pool_isolate_shutdown_sample.dart' as pool_isolate;
-import 'pool_sample.dart' as pool;
-import 'pool_zoned_sample.dart' as pool_zoned;
+import 'arena_isolate_shutdown_sample.dart' as arena_isolate;
+import 'arena_sample.dart' as arena;
+import 'arena_zoned_sample.dart' as arena_zoned;
import 'unmanaged_sample.dart' as unmanaged;
main() {
- pool_isolate.main();
- pool.main();
- pool_zoned.main();
+ arena_isolate.main();
+ arena.main();
+ arena_zoned.main();
unmanaged.main();
}
diff --git a/samples_2/ffi/resource_management/unmanaged_sample.dart b/samples_2/ffi/resource_management/unmanaged_sample.dart
index fa5a60b..0cf460b 100644
--- a/samples_2/ffi/resource_management/unmanaged_sample.dart
+++ b/samples_2/ffi/resource_management/unmanaged_sample.dart
@@ -24,7 +24,7 @@
// To ensure resources are freed, call free manually.
//
- // For automatic management use a Pool.
+ // For automatic management use a Arena.
final p = calloc<Int64>(2);
p[0] = 24;
MemMove(p.elementAt(1).cast<Void>(), p.cast<Void>(), sizeOf<Int64>());
diff --git a/samples_2/ffi/resource_management/utf8_helpers.dart b/samples_2/ffi/resource_management/utf8_helpers.dart
index f3d574d..64cc601 100644
--- a/samples_2/ffi/resource_management/utf8_helpers.dart
+++ b/samples_2/ffi/resource_management/utf8_helpers.dart
@@ -2,7 +2,7 @@
// 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.
//
-// Explicit pool used for managing resources.
+// Explicit arena used for managing resources.
// @dart = 2.9
@@ -12,7 +12,7 @@
import 'package:ffi/ffi.dart';
-extension Utf8InPool on String {
+extension Utf8InArena on String {
/// Convert a [String] to a Utf8-encoded null-terminated C string.
///
/// If 'string' contains NULL bytes, the converted string will be truncated
diff --git a/sdk/bin/dart2native b/sdk/bin/dart2native
index 057490f..6f59f3f 100755
--- a/sdk/bin/dart2native
+++ b/sdk/bin/dart2native
@@ -5,6 +5,8 @@
# Run dart2native.dart.snapshot on the Dart VM
+echo "Warning: 'dart2native' is deprecated. Please use 'dart compile exe'." 1>&2
+
function follow_links() {
file="$1"
while [ -h "$file" ]; do
diff --git a/sdk/bin/dart2native.bat b/sdk/bin/dart2native.bat
index 631dce8..ca4d8d7 100644
--- a/sdk/bin/dart2native.bat
+++ b/sdk/bin/dart2native.bat
@@ -3,6 +3,8 @@
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.
+echo Warning: 'dart2native' is deprecated. Please use 'dart compile exe'. 1>&2
+
setlocal
rem Handle the case where dart-sdk/bin has been symlinked to.
set DIR_NAME_WITH_SLASH=%~dp0
diff --git a/tests/ffi/ffi.status b/tests/ffi/ffi.status
index 82349e8..16826bf 100644
--- a/tests/ffi/ffi.status
+++ b/tests/ffi/ffi.status
@@ -5,6 +5,9 @@
[ $builder_tag == msan ]
vmspecific_handle_test: Skip # https://dartbug.com/42314
+[ $compiler == app_jitk ]
+vmspecific_leaf_call_test: Skip # https://dartbug.com/46125: Snapshot fails to generate.
+
[ $mode == debug ]
function_callbacks_structs_by_value_generated_test: Pass, Slow
diff --git a/tests/ffi_2/ffi_2.status b/tests/ffi_2/ffi_2.status
index 82349e8..16826bf 100644
--- a/tests/ffi_2/ffi_2.status
+++ b/tests/ffi_2/ffi_2.status
@@ -5,6 +5,9 @@
[ $builder_tag == msan ]
vmspecific_handle_test: Skip # https://dartbug.com/42314
+[ $compiler == app_jitk ]
+vmspecific_leaf_call_test: Skip # https://dartbug.com/46125: Snapshot fails to generate.
+
[ $mode == debug ]
function_callbacks_structs_by_value_generated_test: Pass, Slow
diff --git a/tests/language/constructor/reference_test.dart b/tests/language/constructor/reference_test.dart
index 9246d2b..f57a26f 100644
--- a/tests/language/constructor/reference_test.dart
+++ b/tests/language/constructor/reference_test.dart
@@ -92,12 +92,13 @@
Foo<int>();
Foo<int>.bar();
Foo<int>.bar.baz();
- // ^^^
- // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
- // [cfe] Expected '(' after this.
- // ^^^
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
- // [cfe] The method 'baz' isn't defined for the class 'Foo<int>'.
+//^^^
+// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION
+ // ^^^^^
+ // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
+ // [cfe] This requires the 'constructor-tearoffs' language feature to be enabled.
+ // ^
+ // [cfe] Getter not found: 'bar'.
Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
diff --git a/tests/language_2/constructor/reference_test.dart b/tests/language_2/constructor/reference_test.dart
index f4fa2fe..73abdb9 100644
--- a/tests/language_2/constructor/reference_test.dart
+++ b/tests/language_2/constructor/reference_test.dart
@@ -94,12 +94,13 @@
Foo<int>();
Foo<int>.bar();
Foo<int>.bar.baz();
- // ^^^
- // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
- // [cfe] Expected '(' after this.
- // ^^^
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
- // [cfe] The method 'baz' isn't defined for the class 'Foo<int>'.
+//^^^
+// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION
+ // ^^^^^
+ // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
+ // [cfe] This requires the 'constructor-tearoffs' language feature to be enabled.
+ // ^
+ // [cfe] Getter not found: 'bar'.
Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
diff --git a/tools/VERSION b/tools/VERSION
index bc449ec..865c9b1 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 150
+PRERELEASE 151
PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/bots/aot_smoke_tests.dart b/tools/bots/aot_smoke_tests.dart
index b9a035e..406fb08 100755
--- a/tools/bots/aot_smoke_tests.dart
+++ b/tools/bots/aot_smoke_tests.dart
@@ -15,12 +15,11 @@
import 'package:test/test.dart';
final String newline = Platform.isWindows ? '\r\n' : '\n';
-final String scriptSuffix = Platform.isWindows ? ".bat" : "";
final String executableSuffix = Platform.isWindows ? ".exe" : "";
final String sdkBinDir = path.dirname(Platform.executable);
final String dartaotruntime =
path.join(sdkBinDir, 'dartaotruntime${executableSuffix}');
-final String dart2native = path.join(sdkBinDir, 'dart2native${scriptSuffix}');
+final String dart = path.join(sdkBinDir, 'dart${executableSuffix}');
Future<void> withTempDir(Future fun(String dir)) async {
final Directory tempDir = Directory.systemTemp.createTempSync();
@@ -32,14 +31,14 @@
}
void main(List<String> args) {
- test("dart2native: Can compile and run AOT", () async {
+ test("Dart native: Can compile and run AOT snapshot", () async {
await withTempDir((String tmp) async {
final String testCode = path.join('tools', 'bots', 'dart_aot_test.dart');
final String tmpAot = path.join(tmp, 'dart_aot_test.aot');
{
- final ProcessResult result = await Process.run(dart2native,
- [testCode, '--output', tmpAot, '--output-kind', 'aot']);
+ final ProcessResult result = await Process.run(
+ dart, ['compile', 'aot-snapshot', testCode, '--output', tmpAot]);
expect(result.stderr, '');
expect(result.exitCode, 0);
}
@@ -55,14 +54,14 @@
});
});
- test("dart2native: Can compile and run exe", () async {
+ test("Dart native: Can compile and run exe", () async {
await withTempDir((String tmp) async {
final String testCode = path.join('tools', 'bots', 'dart_aot_test.dart');
final String tmpExe = path.join(tmp, 'dart_aot_test.exe');
{
- final ProcessResult result =
- await Process.run(dart2native, [testCode, '--output', tmpExe]);
+ final ProcessResult result = await Process.run(
+ dart, ['compile', 'exe', testCode, '--output', tmpExe]);
expect(result.stderr, '');
expect(result.exitCode, 0);
}
@@ -77,27 +76,27 @@
});
});
- test("dart2native: Returns non-zero on missing file.", () async {
+ test("Dart native: Returns non-zero on missing file.", () async {
await withTempDir((String tmp) async {
final String testCode = path.join(tmp, 'does_not_exist.dart');
final String tmpExe = path.join(tmp, 'dart_aot_test.exe');
{
- final ProcessResult result =
- await Process.run(dart2native, [testCode, '--output', tmpExe]);
+ final ProcessResult result = await Process.run(
+ dart, ['compile', 'exe', testCode, '--output', tmpExe]);
expect(result.exitCode, isNonZero);
}
});
});
- test("dart2native: Returns non-zero on non-file.", () async {
+ test("Dart native: Returns non-zero on non-file.", () async {
await withTempDir((String tmp) async {
final String testCode = tmp; // This is a directory, not a file.
final String tmpExe = path.join(tmp, 'dart_aot_test.exe');
{
- final ProcessResult result =
- await Process.run(dart2native, [testCode, '--output', tmpExe]);
+ final ProcessResult result = await Process.run(
+ dart, ['compile', 'exe', testCode, '--output', tmpExe]);
expect(result.exitCode, isNonZero);
}
});
diff --git a/tools/bots/dart_aot_test.dart b/tools/bots/dart_aot_test.dart
index a1657c1..9449b27 100755
--- a/tools/bots/dart_aot_test.dart
+++ b/tools/bots/dart_aot_test.dart
@@ -3,7 +3,7 @@
// 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.
-// Test program for Dart AOT (dart2native, dartaotruntime).
+// Test program for Dart AOT (dart compile, dartaotruntime).
void main(List<String> args) async {
final String who = !args.isEmpty ? args[0] : '世界';