Version 2.0.0-dev.11.0
Merge commit '7f91a438f54fa262ff5ebba987fbda234e63d51e' into dev
diff --git a/pkg/analysis_server/test/benchmarks_test.dart b/pkg/analysis_server/test/benchmarks_test.dart
index 4cd4a46..5c6ecc1 100644
--- a/pkg/analysis_server/test/benchmarks_test.dart
+++ b/pkg/analysis_server/test/benchmarks_test.dart
@@ -53,7 +53,7 @@
);
expect(r.exitCode, 0,
reason: 'exit: ${r.exitCode}\n${r.stdout}\n${r.stderr}');
- });
+ }, skip: true); // #31554
}
});
}
diff --git a/pkg/analysis_server/test/integration/analytics/enable_test.dart b/pkg/analysis_server/test/integration/analytics/enable_test.dart
index a32971f..d7dfdfd 100644
--- a/pkg/analysis_server/test/integration/analytics/enable_test.dart
+++ b/pkg/analysis_server/test/integration/analytics/enable_test.dart
@@ -11,6 +11,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(EnableTest);
+ defineReflectiveTests(EnableTest_PreviewDart2);
});
}
@@ -31,3 +32,9 @@
expect(result2.enabled, result1.enabled);
}
}
+
+@reflectiveTest
+class EnableTest_PreviewDart2 extends EnableTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/analytics/is_enabled_test.dart b/pkg/analysis_server/test/integration/analytics/is_enabled_test.dart
index 8e2ffd5..daf089d 100644
--- a/pkg/analysis_server/test/integration/analytics/is_enabled_test.dart
+++ b/pkg/analysis_server/test/integration/analytics/is_enabled_test.dart
@@ -11,6 +11,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(IsEnabledTest);
+ defineReflectiveTests(IsEnabledTest_PreviewDart2);
});
}
@@ -24,3 +25,9 @@
expect(result, isNotNull);
}
}
+
+@reflectiveTest
+class IsEnabledTest_PreviewDart2 extends IsEnabledTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/analytics/send_event_test.dart b/pkg/analysis_server/test/integration/analytics/send_event_test.dart
index fbeb48a..1098697 100644
--- a/pkg/analysis_server/test/integration/analytics/send_event_test.dart
+++ b/pkg/analysis_server/test/integration/analytics/send_event_test.dart
@@ -10,6 +10,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(SendEventTest);
+ defineReflectiveTests(SendEventTest_PreviewDart2);
});
}
@@ -29,3 +30,9 @@
await sendAnalyticsEnable(result1.enabled);
}
}
+
+@reflectiveTest
+class SendEventTest_PreviewDart2 extends SendEventTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/analytics/send_timing_test.dart b/pkg/analysis_server/test/integration/analytics/send_timing_test.dart
index fb65d8a..03ff2c4 100644
--- a/pkg/analysis_server/test/integration/analytics/send_timing_test.dart
+++ b/pkg/analysis_server/test/integration/analytics/send_timing_test.dart
@@ -10,6 +10,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(SendTimingTest);
+ defineReflectiveTests(SendTimingTest_PreviewDart2);
});
}
@@ -29,3 +30,9 @@
await sendAnalyticsEnable(result1.enabled);
}
}
+
+@reflectiveTest
+class SendTimingTest_PreviewDart2 extends SendTimingTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/diagnostic/get_diagnostics_test.dart b/pkg/analysis_server/test/integration/diagnostic/get_diagnostics_test.dart
index e8bf76e..282b5f7 100644
--- a/pkg/analysis_server/test/integration/diagnostic/get_diagnostics_test.dart
+++ b/pkg/analysis_server/test/integration/diagnostic/get_diagnostics_test.dart
@@ -11,6 +11,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(GetDiagnosticsTest);
+ defineReflectiveTests(GetDiagnosticsTest_PreviewDart2);
});
}
@@ -28,3 +29,9 @@
expect(context.name, isNotEmpty);
}
}
+
+@reflectiveTest
+class GetDiagnosticsTest_PreviewDart2 extends GetDiagnosticsTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/diagnostic/get_server_port_test.dart b/pkg/analysis_server/test/integration/diagnostic/get_server_port_test.dart
index b04384f..d4009e6 100644
--- a/pkg/analysis_server/test/integration/diagnostic/get_server_port_test.dart
+++ b/pkg/analysis_server/test/integration/diagnostic/get_server_port_test.dart
@@ -14,6 +14,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(GetServerPortTest);
+ defineReflectiveTests(GetServerPortTest_PreviewDart2);
});
}
@@ -35,3 +36,9 @@
expect(responseBody, contains('<title>Analysis Server</title>'));
}
}
+
+@reflectiveTest
+class GetServerPortTest_PreviewDart2 extends GetServerPortTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/execution/create_context_test.dart b/pkg/analysis_server/test/integration/execution/create_context_test.dart
index 6564810..841a427 100644
--- a/pkg/analysis_server/test/integration/execution/create_context_test.dart
+++ b/pkg/analysis_server/test/integration/execution/create_context_test.dart
@@ -10,6 +10,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(CreateContextTest);
+ defineReflectiveTests(CreateContextTest_PreviewDart2);
});
}
@@ -22,3 +23,9 @@
expect(contextId, isNotNull);
}
}
+
+@reflectiveTest
+class CreateContextTest_PreviewDart2 extends CreateContextTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/execution/delete_context_test.dart b/pkg/analysis_server/test/integration/execution/delete_context_test.dart
index c807fa5..5277069 100644
--- a/pkg/analysis_server/test/integration/execution/delete_context_test.dart
+++ b/pkg/analysis_server/test/integration/execution/delete_context_test.dart
@@ -11,6 +11,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(DeleteContextTest);
+ defineReflectiveTests(DeleteContextTest_PreviewDart2);
});
}
@@ -41,3 +42,9 @@
}
}
}
+
+@reflectiveTest
+class DeleteContextTest_PreviewDart2 extends DeleteContextTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/execution/map_uri_test.dart b/pkg/analysis_server/test/integration/execution/map_uri_test.dart
index f5abbc0..8b186cb 100644
--- a/pkg/analysis_server/test/integration/execution/map_uri_test.dart
+++ b/pkg/analysis_server/test/integration/execution/map_uri_test.dart
@@ -11,6 +11,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(MapUriTest);
+ defineReflectiveTests(MapUriTest_PreviewDart2);
});
}
@@ -38,3 +39,9 @@
}
}
}
+
+@reflectiveTest
+class MapUriTest_PreviewDart2 extends MapUriTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/execution/set_subscriptions_test.dart b/pkg/analysis_server/test/integration/execution/set_subscriptions_test.dart
index 441093b..09835d7 100644
--- a/pkg/analysis_server/test/integration/execution/set_subscriptions_test.dart
+++ b/pkg/analysis_server/test/integration/execution/set_subscriptions_test.dart
@@ -10,6 +10,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(SetSubscriptionsTest);
+ defineReflectiveTests(SetSubscriptionsTest_PreviewDart2);
});
}
@@ -21,3 +22,9 @@
await sendExecutionSetSubscriptions([ExecutionService.LAUNCH_DATA]);
}
}
+
+@reflectiveTest
+class SetSubscriptionsTest_PreviewDart2 extends SetSubscriptionsTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/kythe/get_kythe_entries_test.dart b/pkg/analysis_server/test/integration/kythe/get_kythe_entries_test.dart
index ccd3c49..13ae694 100644
--- a/pkg/analysis_server/test/integration/kythe/get_kythe_entries_test.dart
+++ b/pkg/analysis_server/test/integration/kythe/get_kythe_entries_test.dart
@@ -11,6 +11,7 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(GetKytheEntriesTest);
+ defineReflectiveTests(GetKytheEntriesTest_PreviewDart2);
});
}
@@ -37,3 +38,9 @@
expect(result.files, isEmpty);
}
}
+
+@reflectiveTest
+class GetKytheEntriesTest_PreviewDart2 extends GetKytheEntriesTest {
+ @override
+ bool get usePreviewDart2 => true;
+}
diff --git a/pkg/analysis_server/test/integration/support/integration_tests.dart b/pkg/analysis_server/test/integration/support/integration_tests.dart
index 5f2504d..f8dc21a 100644
--- a/pkg/analysis_server/test/integration/support/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/support/integration_tests.dart
@@ -253,6 +253,12 @@
}
/**
+ * Whether to run integration tests with the --preview-dart-2 flag.
+ */
+ // TODO(devoncarew): Remove this when --preview-dart-2 goes away.
+ bool get usePreviewDart2 => false;
+
+ /**
* Start [server].
*/
Future startServer({
@@ -265,7 +271,7 @@
checked: checked,
diagnosticPort: diagnosticPort,
servicesPort: servicesPort,
- previewDart2: previewDart2);
+ previewDart2: previewDart2 || usePreviewDart2);
}
/**
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
index 7998638..49ab5d7 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
@@ -718,12 +718,19 @@
for (var declaration in unit.declarations) {
if (declaration is ClassDeclaration) {
+ if (declaration.metadata.isNotEmpty) {
+ var resolution = resolutions.next();
+ var applier = _createResolutionApplier(null, resolution);
+ applier.applyToAnnotations(declaration);
+ applier.checkDone();
+ }
for (var member in declaration.members) {
if (member is ConstructorDeclaration) {
// TODO(scheglov) Pass in the actual context element.
var resolution = resolutions.next();
var applier = _createResolutionApplier(null, resolution);
member.body.accept(applier);
+ applier.applyToAnnotations(member);
applier.checkDone();
} else if (member is FieldDeclaration) {
if (member.fields.variables.length != 1) {
@@ -734,12 +741,15 @@
var resolution = resolutions.next();
var applier = _createResolutionApplier(null, resolution);
member.fields.variables[0].initializer?.accept(applier);
+ applier.applyToAnnotations(member);
applier.checkDone();
} else if (member is MethodDeclaration) {
ExecutableElementImpl context = member.element;
var resolution = resolutions.next();
var applier = _createResolutionApplier(context, resolution);
+ member.parameters?.accept(applier);
member.body.accept(applier);
+ applier.applyToAnnotations(member);
applier.checkDone();
} else {
// TODO(scheglov) Handle more cases.
@@ -752,6 +762,7 @@
var applier = _createResolutionApplier(context, resolution);
declaration.functionExpression.parameters?.accept(applier);
declaration.functionExpression.body.accept(applier);
+ applier.applyToAnnotations(declaration);
applier.checkDone();
} else if (declaration is TopLevelVariableDeclaration) {
if (declaration.variables.variables.length != 1) {
@@ -762,6 +773,7 @@
var resolution = resolutions.next();
var applier = _createResolutionApplier(null, resolution);
declaration.variables.variables[0].initializer?.accept(applier);
+ applier.applyToAnnotations(declaration);
applier.checkDone();
} else {
// TODO(scheglov) Handle more cases.
@@ -1062,17 +1074,20 @@
referencedElements.add(element);
}
- applier = new ValidatingResolutionApplier(
+ applier = new ResolutionApplier(
this,
declaredElements,
- referencedElements,
- resolution.kernelTypes,
resolution.declarationOffsets,
+ referencedElements,
resolution.referenceOffsets,
+ resolution.kernelTypes,
resolution.typeOffsets);
}
@override
+ DartType get stringType => typeProvider.stringType;
+
+ @override
DartType get typeType => typeProvider.typeType;
@override
@@ -1146,15 +1161,25 @@
}
// Convert kernel type arguments into Analyzer types.
- var astTypeArguments = new List<DartType>(astTypeParameters.length);
- for (var i = 0; i < astTypeParameters.length; i++) {
+ int length = astTypeParameters.length;
+ var usedTypeParameters = <TypeParameterElement>[];
+ var usedTypeArguments = <DartType>[];
+ for (var i = 0; i < length; i++) {
var kernelParameter = kernelTypeParameters[i];
var kernelArgument = kernelMap[kernelParameter];
- astTypeArguments[i] = resynthesizer.getType(null, kernelArgument);
+ if (kernelArgument != null) {
+ DartType astArgument = resynthesizer.getType(null, kernelArgument);
+ usedTypeParameters.add(astTypeParameters[i]);
+ usedTypeArguments.add(astArgument);
+ }
+ }
+
+ if (usedTypeParameters.isEmpty) {
+ return rawType;
}
// Replace Analyzer type parameters with type arguments.
- return rawType.substitute4(astTypeParameters, astTypeArguments);
+ return rawType.substitute4(usedTypeParameters, usedTypeArguments);
}
/// Translate the given [declaration].
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 794a3c6..7c01ac3 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -1024,6 +1024,7 @@
node = ast.functionTypedFormalParameter2(
identifier: name,
comment: comment,
+ metadata: metadata,
covariantKeyword: covariantKeyword,
returnType: typeOrFunctionTypedParameter.returnType,
typeParameters: typeOrFunctionTypedParameter.typeParameters,
@@ -1032,6 +1033,7 @@
node = ast.fieldFormalParameter2(
identifier: name,
comment: comment,
+ metadata: metadata,
covariantKeyword: covariantKeyword,
type: typeOrFunctionTypedParameter.returnType,
thisKeyword: thisKeyword,
@@ -1044,6 +1046,7 @@
if (thisKeyword == null) {
node = ast.simpleFormalParameter2(
comment: comment,
+ metadata: metadata,
covariantKeyword: covariantKeyword,
keyword: keyword,
type: type,
@@ -1051,6 +1054,7 @@
} else {
node = ast.fieldFormalParameter2(
comment: comment,
+ metadata: metadata,
covariantKeyword: covariantKeyword,
keyword: keyword,
type: type,
@@ -1064,6 +1068,11 @@
if (analyzerKind != ParameterKind.REQUIRED) {
node = ast.defaultFormalParameter(
node, analyzerKind, defaultValue?.separator, defaultValue?.value);
+ } else if (defaultValue != null) {
+ // An error is reported if a required parameter has a default value.
+ // Record it as named parameter for recovery.
+ node = ast.defaultFormalParameter(node, ParameterKind.NAMED,
+ defaultValue.separator, defaultValue.value);
}
push(node);
}
@@ -1273,8 +1282,14 @@
}
@override
- void handleInvalidFunctionBody(Token token) {
+ void handleInvalidFunctionBody(Token leftBracket) {
+ assert(optional('{', leftBracket));
+ assert(optional('}', leftBracket.endGroup));
debugEvent("InvalidFunctionBody");
+ Block block = ast.block(leftBracket, [], leftBracket.endGroup);
+ Token star = pop();
+ Token asyncKeyword = pop();
+ push(ast.blockFunctionBody(asyncKeyword, star, block));
}
@override
diff --git a/pkg/analyzer/lib/src/fasta/error_converter.dart b/pkg/analyzer/lib/src/fasta/error_converter.dart
index d3e73a5..0b61844 100644
--- a/pkg/analyzer/lib/src/fasta/error_converter.dart
+++ b/pkg/analyzer/lib/src/fasta/error_converter.dart
@@ -364,6 +364,10 @@
errorReporter?.reportErrorForOffset(
ParserErrorCode.NAMED_FUNCTION_EXPRESSION, offset, length);
return;
+ case "NAMED_PARAMETER_OUTSIDE_GROUP":
+ errorReporter?.reportErrorForOffset(
+ ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, offset, length);
+ return;
case "NATIVE_CLAUSE_SHOULD_BE_ANNOTATION":
errorReporter?.reportErrorForOffset(
ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, offset, length);
@@ -408,6 +412,18 @@
errorReporter?.reportErrorForOffset(
ParserErrorCode.TYPEDEF_IN_CLASS, offset, length);
return;
+ case "UNDEFINED_GETTER":
+ errorReporter?.reportErrorForOffset(
+ StaticTypeWarningCode.UNDEFINED_GETTER, offset, length);
+ return;
+ case "UNDEFINED_METHOD":
+ errorReporter?.reportErrorForOffset(
+ StaticTypeWarningCode.UNDEFINED_METHOD, offset, length);
+ return;
+ case "UNDEFINED_SETTER":
+ errorReporter?.reportErrorForOffset(
+ StaticTypeWarningCode.UNDEFINED_SETTER, offset, length);
+ return;
case "UNEXPECTED_TOKEN":
String text = stringOrTokenLexeme();
if (text == ';') {
diff --git a/pkg/analyzer/lib/src/fasta/resolution_applier.dart b/pkg/analyzer/lib/src/fasta/resolution_applier.dart
index fca1a17..a865cb1 100644
--- a/pkg/analyzer/lib/src/fasta/resolution_applier.dart
+++ b/pkg/analyzer/lib/src/fasta/resolution_applier.dart
@@ -19,37 +19,68 @@
/// Visitor that applies resolution data from the front end (obtained via
/// [ResolutionStorer]) to an analyzer AST.
class ResolutionApplier extends GeneralizingAstVisitor {
+ /// Indicates whether debug messages should be printed.
+ static const bool _debug = false;
+
final TypeContext _typeContext;
final List<Element> _declaredElements;
+ final List<int> _declaredElementOffsets;
int _declaredElementIndex = 0;
final List<Element> _referencedElements;
+ final List<int> _referencedElementOffsets;
int _referencedElementIndex = 0;
final List<kernel.DartType> _types;
+ final List<int> _typeOffsets;
int _typeIndex = 0;
- ResolutionApplier(this._typeContext, this._declaredElements,
- this._referencedElements, this._types);
+ /// Indicates whether we are applying resolution to an annotation.
+ ///
+ /// When this field is `true`, [PropertyInducingElement]s should be replaced
+ /// with corresponding getters.
+ bool _inAnnotation = false;
+
+ ResolutionApplier(
+ this._typeContext,
+ this._declaredElements,
+ this._declaredElementOffsets,
+ this._referencedElements,
+ this._referencedElementOffsets,
+ this._types,
+ this._typeOffsets);
+
+ /// Apply resolution to annotations of the given [node].
+ void applyToAnnotations(AnnotatedNode node) {
+ _inAnnotation = true;
+ node.metadata.accept(this);
+ _inAnnotation = false;
+ }
/// Verifies that all types passed to the constructor have been applied.
void checkDone() {
if (_declaredElementIndex != _declaredElements.length) {
throw new StateError('Some declarations were not consumed, starting at '
- '${_declaredElements[_declaredElementIndex]}');
+ 'offset ${_declaredElementOffsets[_declaredElementIndex]}');
}
if (_referencedElementIndex != _referencedElements.length) {
throw new StateError('Some references were not consumed, starting at '
- '${_referencedElements[_referencedElementIndex]}');
+ 'offset ${_referencedElementOffsets[_referencedElementIndex]}');
}
if (_typeIndex != _types.length) {
- throw new StateError(
- 'Some types were not consumed, starting at ${_types[_typeIndex]}');
+ throw new StateError('Some types were not consumed, starting at offset '
+ '${_typeOffsets[_typeIndex]}');
}
}
@override
+ void visitAdjacentStrings(AdjacentStrings node) {
+ node.strings.accept(this);
+ node.staticType = _typeContext.stringType;
+ }
+
+ @override
void visitAsExpression(AsExpression node) {
node.expression.accept(this);
applyToTypeAnnotation(_getTypeFor(node.asOperator), node.type);
@@ -70,10 +101,13 @@
void visitBinaryExpression(BinaryExpression node) {
node.leftOperand.accept(this);
- node.staticElement = _getReferenceFor(node.operator);
-
- // Skip the function type of the operator.
- _getTypeFor(node.operator);
+ TokenType operatorType = node.operator.type;
+ if (operatorType != TokenType.QUESTION_QUESTION &&
+ operatorType != TokenType.AMPERSAND_AMPERSAND &&
+ operatorType != TokenType.BAR_BAR) {
+ node.staticElement = _getReferenceFor(node.operator);
+ _getTypeFor(node.operator); // function type of the operator
+ }
// Record the return type of the expression.
node.staticType = _getTypeFor(node.operator);
@@ -81,8 +115,8 @@
node.rightOperand.accept(this);
// Skip the synthetic Not for `!=`.
- if (node.operator.type == TokenType.BANG_EQ) {
- _getTypeFor(node.operator, synthetic: true);
+ if (operatorType == TokenType.BANG_EQ) {
+ _getTypeFor(null, synthetic: true);
}
}
@@ -101,6 +135,33 @@
}
@override
+ void visitForEachStatement(ForEachStatement node) {
+ DeclaredIdentifier loopVariable = node.loopVariable;
+ if (loopVariable != null) {
+ SimpleIdentifier identifier = loopVariable.identifier;
+
+ DartType type = _getTypeFor(identifier);
+ identifier.staticType = type;
+
+ if (loopVariable.type != null) {
+ applyToTypeAnnotation(type, loopVariable.type);
+ }
+
+ VariableElementImpl element = _getDeclarationFor(identifier);
+ if (element != null) {
+ _typeContext.encloseVariable(element);
+ identifier.staticElement = element;
+ element.type = type;
+ }
+ } else {
+ node.identifier.staticElement = _getReferenceFor(node.identifier);
+ node.identifier.staticType = _getTypeFor(node.identifier);
+ }
+ node.iterable.accept(this);
+ node.body.accept(this);
+ }
+
+ @override
void visitFormalParameterList(FormalParameterList parameterList) {
for (var parameter in parameterList.parameters) {
if (parameter is DefaultFormalParameter) {
@@ -108,7 +169,7 @@
// Consume the Null type, for the implicit default value.
_getTypeFor(null, synthetic: true);
} else {
- throw new UnimplementedError();
+ parameter.defaultValue.accept(this);
}
}
}
@@ -166,11 +227,14 @@
void visitIndexExpression(IndexExpression node) {
node.target.accept(this);
- // Convert the raw element into a member.
- InterfaceType targetType = node.target.staticType;
+ DartType targetType = node.target.staticType;
MethodElement element = _getReferenceFor(node.leftBracket);
- MethodElement member = MethodMember.from(element, targetType);
- node.staticElement = member;
+
+ // Convert the raw element into a member.
+ if (targetType is InterfaceType) {
+ MethodElement member = MethodMember.from(element, targetType);
+ node.staticElement = member;
+ }
// We cannot use the detached FunctionType of `[]` or `[]=`.
_getTypeFor(node.leftBracket);
@@ -297,8 +361,36 @@
@override
void visitPrefixedIdentifier(PrefixedIdentifier node) {
- node.prefix.accept(this);
- node.identifier.accept(this);
+ Element element =
+ _getReferenceFor(node.identifier, nullIfDifferentOffset: true);
+ if (element != null) {
+ // If the element is for the identifier, then this is a static element.
+ DartType type = _getTypeFor(node.identifier);
+ if (element is PropertyAccessorElement) {
+ assert(element.isStatic);
+ node.identifier.staticElement = element;
+ node.identifier.staticType = type;
+ var enclosingElement = element.enclosingElement;
+ if (enclosingElement is ClassElement) {
+ node.prefix.staticElement = enclosingElement;
+ node.prefix.staticType = enclosingElement.type;
+ } else {
+ // TODO(scheglov) Support for prefixed top-level variables?
+ throw new UnimplementedError('(${element.runtimeType}) $element');
+ }
+ } else {
+ // TODO(scheglov) Support for methods?
+ throw new UnimplementedError('(${element.runtimeType}) $element');
+ }
+ } else {
+ // If the element is not for the identifier, this is actually a property.
+ // The element and type must be for the prefix.
+ node.prefix.staticElement = _getReferenceFor(node.prefix);
+ node.prefix.staticType = _getTypeFor(node.prefix);
+ // The resolution for the identifier follows.
+ node.identifier.staticElement = _getReferenceFor(node.identifier);
+ node.identifier.staticType = _getTypeFor(node.identifier);
+ }
node.staticType = node.identifier.staticType;
}
@@ -349,7 +441,7 @@
element.expression.accept(this);
}
}
- node.staticType = _getTypeFor(node.endToken.next);
+ node.staticType = _typeContext.stringType;
}
@override
@@ -459,13 +551,51 @@
/// Return the element associated with the declaration represented by the
/// given [node].
Element _getDeclarationFor(AstNode node) {
+ int nodeOffset = node.offset;
+ if (_debug) {
+ print('Getting declaration element for $node at $nodeOffset');
+ }
+ if (_declaredElementIndex >= _declaredElements.length) {
+ throw new StateError(
+ 'No declaration information for $node at $nodeOffset');
+ }
+ int elementOffset = _declaredElementOffsets[_declaredElementIndex];
+ if (nodeOffset != elementOffset) {
+ throw new StateError(
+ 'Expected element declaration for analyzer offset $nodeOffset; '
+ 'got one for kernel offset $elementOffset');
+ }
+
return _declaredElements[_declaredElementIndex++];
}
/// Return the element associated with the reference represented by the
/// given [entity].
- Element _getReferenceFor(SyntacticEntity entity) {
- return _referencedElements[_referencedElementIndex++];
+ Element _getReferenceFor(SyntacticEntity entity,
+ {bool nullIfDifferentOffset: false}) {
+ int entityOffset = entity.offset;
+ if (_debug) {
+ print('Getting reference element for $entity at $entityOffset');
+ }
+ if (_referencedElementIndex >= _referencedElements.length) {
+ throw new StateError(
+ 'No reference information for $entity at $entityOffset');
+ }
+ int elementOffset = _referencedElementOffsets[_referencedElementIndex];
+ if (entityOffset != elementOffset) {
+ if (nullIfDifferentOffset) {
+ return null;
+ }
+ throw new StateError(
+ 'Expected element reference for analyzer offset $entityOffset; '
+ 'got one for kernel offset $elementOffset');
+ }
+
+ Element element = _referencedElements[_referencedElementIndex++];
+ if (_inAnnotation && element is PropertyInducingElement) {
+ return element.getter;
+ }
+ return element;
}
/// Return the type associated with the given [entity].
@@ -475,6 +605,19 @@
/// optional parameter (i.e. [Null]).
DartType _getTypeFor(SyntacticEntity entity, {bool synthetic: false}) {
assert(!synthetic || entity == null);
+
+ var entityOffset = synthetic ? -1 : entity.offset;
+ if (_debug) {
+ print('Getting type for $entity at $entityOffset');
+ }
+ if (_typeIndex >= _types.length) {
+ throw new StateError('No type information for $entity at $entityOffset');
+ }
+ if (entityOffset != _typeOffsets[_typeIndex]) {
+ throw new StateError('Expected a type for $entity at $entityOffset; '
+ 'got one for kernel offset ${_typeOffsets[_typeIndex]}');
+ }
+
kernel.DartType kernelType = _types[_typeIndex++];
return _typeContext.translateType(kernelType);
}
@@ -586,6 +729,8 @@
/// The enclosing [ClassElement], or `null` if not in a class.
ClassElement get enclosingClassElement;
+ DartType get stringType;
+
DartType get typeType;
/// Attach the variable [element] to the current executable.
@@ -601,95 +746,3 @@
/// Return the Analyzer [DartType] for the given [kernelType].
DartType translateType(kernel.DartType kernelType);
}
-
-/// Visitor that applies resolution data from the front end (obtained via
-/// [ResolutionStorer]) to an analyzer AST, and also checks file offsets to
-/// verify that the types are applied to the correct subexpressions.
-class ValidatingResolutionApplier extends ResolutionApplier {
- /// Indicates whether debug messages should be printed.
- static const bool _debug = false;
-
- final List<int> _declaredElementOffsets;
- final List<int> _referencedElementOffsets;
- final List<int> _typeOffsets;
-
- ValidatingResolutionApplier(
- TypeContext typeContext,
- List<Element> declaredElements,
- List<Element> referencedElements,
- List<kernel.DartType> types,
- this._declaredElementOffsets,
- this._referencedElementOffsets,
- this._typeOffsets)
- : super(typeContext, declaredElements, referencedElements, types);
-
- @override
- void checkDone() {
- if (_declaredElementIndex != _declaredElements.length) {
- throw new StateError('Some declarations were not consumed, starting at '
- 'offset ${_declaredElementOffsets[_declaredElementIndex]}');
- }
- if (_referencedElementIndex != _referencedElements.length) {
- throw new StateError('Some references were not consumed, starting at '
- 'offset ${_referencedElementOffsets[_referencedElementIndex]}');
- }
- if (_typeIndex != _types.length) {
- throw new StateError('Some types were not consumed, starting at offset '
- '${_typeOffsets[_typeIndex]}');
- }
- }
-
- @override
- Element _getDeclarationFor(AstNode node) {
- int nodeOffset = node.offset;
- if (_debug) {
- print('Getting declaration element for $node at $nodeOffset');
- }
- if (_declaredElementIndex >= _declaredElements.length) {
- throw new StateError(
- 'No declaration information for $node at $nodeOffset');
- }
- int elementOffset = _declaredElementOffsets[_declaredElementIndex];
- if (nodeOffset != elementOffset) {
- throw new StateError(
- 'Expected element declaration for analyzer offset $nodeOffset; '
- 'got one for kernel offset $elementOffset');
- }
- return super._getDeclarationFor(node);
- }
-
- @override
- Element _getReferenceFor(SyntacticEntity entity) {
- int entityOffset = entity.offset;
- if (_debug) {
- print('Getting reference element for $entity at $entityOffset');
- }
- if (_referencedElementIndex >= _referencedElements.length) {
- throw new StateError(
- 'No reference information for $entity at $entityOffset');
- }
- int elementOffset = _referencedElementOffsets[_referencedElementIndex];
- if (entityOffset != elementOffset) {
- throw new StateError(
- 'Expected element reference for analyzer offset $entityOffset; '
- 'got one for kernel offset $elementOffset');
- }
- return super._getReferenceFor(entity);
- }
-
- @override
- DartType _getTypeFor(SyntacticEntity entity, {bool synthetic: false}) {
- var entityOffset = synthetic ? -1 : entity.offset;
- if (_debug) {
- print('Getting type for $entity at $entityOffset');
- }
- if (_typeIndex >= _types.length) {
- throw new StateError('No type information for $entity at $entityOffset');
- }
- if (entityOffset != _typeOffsets[_typeIndex]) {
- throw new StateError('Expected a type for $entity at $entityOffset; '
- 'got one for kernel offset ${_typeOffsets[_typeIndex]}');
- }
- return super._getTypeFor(entity);
- }
-}
diff --git a/pkg/analyzer/lib/src/fasta/resolution_storer.dart b/pkg/analyzer/lib/src/fasta/resolution_storer.dart
index 8ebf0ed..bcacf81 100644
--- a/pkg/analyzer/lib/src/fasta/resolution_storer.dart
+++ b/pkg/analyzer/lib/src/fasta/resolution_storer.dart
@@ -75,6 +75,7 @@
@override
void _recordDeclaration(Statement declaration, int offset) {
+ if (_inSynthetic) return;
if (_debug) {
print('Recording declaration of $declaration for offset $offset');
}
@@ -84,6 +85,7 @@
@override
int _recordReference(Node target, int offset) {
+ if (_inSynthetic) return -1;
if (_debug) {
print('Recording reference to $target for offset $offset');
}
@@ -93,6 +95,7 @@
@override
int _recordType(DartType type, int offset) {
+ if (_inSynthetic) return -1;
if (_debug) {
print('Recording type $type for offset $offset');
}
@@ -103,6 +106,7 @@
@override
void _replaceReference(Node reference) {
+ if (_inSynthetic) return;
if (_debug) {
int offset = _deferredReferenceOffsets.removeLast();
print('Replacing reference $reference for offset $offset');
@@ -112,6 +116,7 @@
@override
void _replaceType(DartType type, [int newOffset = -1]) {
+ if (_inSynthetic) return;
if (newOffset != -1) {
_typeOffsets[_deferredTypeSlots.last] = newOffset;
}
@@ -199,6 +204,11 @@
/// Indices into [_types] which need to be filled in later.
final _deferredTypeSlots = <int>[];
+ /// When `true`, we are visiting a synthetic structure, which is not
+ /// present in AST, and not visible to Analyzer, so we should not record
+ /// any resolution information for it.
+ bool _inSynthetic = false;
+
ResolutionStorer(this._declarations, this._references, this._types);
@override
@@ -231,6 +241,38 @@
assert(_deferredTypeSlots.isEmpty);
}
+ @override
+ void forInStatementEnter(ForInStatement statement,
+ VariableDeclaration variable, Expression write) {
+ if (variable != null) {
+ _deferType(variable.fileOffset);
+ _recordDeclaration(variable, variable.fileOffset);
+ } else {
+ if (write is VariableSet) {
+ _recordReference(write.variable, write.fileOffset);
+ _recordType(write.variable.type, write.fileOffset);
+ } else if (write is PropertySet) {
+ Field field = write.interfaceTarget;
+ _recordReference(new MemberSetterNode(field), write.fileOffset);
+ _recordType(field.type, write.fileOffset);
+ } else if (write is StaticSet) {
+ Field field = write.target;
+ _recordReference(new MemberSetterNode(field), write.fileOffset);
+ _recordType(field.type, write.fileOffset);
+ } else {
+ throw new UnimplementedError('(${write.runtimeType}) $write');
+ }
+ }
+ }
+
+ @override
+ void forInStatementExit(
+ ForInStatement statement, VariableDeclaration variable) {
+ if (variable != null) {
+ _replaceType(variable.type);
+ }
+ }
+
void functionDeclarationEnter(FunctionDeclaration statement) {
_recordDeclaration(statement.variable, statement.fileOffset);
super.functionDeclarationEnter(statement);
@@ -251,6 +293,16 @@
}
@override
+ void ifNullBeforeRhs(Expression expression) {
+ _deferType(expression.fileOffset);
+ }
+
+ @override
+ void ifNullExit(Expression expression, DartType inferredType) {
+ _replaceType(inferredType);
+ }
+
+ @override
void indexAssignAfterReceiver(Expression write, DartType typeContext) {
_deferReference(write.fileOffset);
_recordType(const IndexAssignNullFunctionType(), write.fileOffset);
@@ -273,6 +325,32 @@
_recordType(inferredType, expression.fileOffset);
}
+ void isNotExpressionExit(
+ Not expression, DartType type, DartType inferredType) {
+ _recordType(type, expression.fileOffset);
+ _recordType(inferredType, expression.fileOffset);
+ }
+
+ @override
+ void logicalExpressionBeforeRhs(LogicalExpression expression) {
+ _deferType(expression.fileOffset);
+ }
+
+ @override
+ void logicalExpressionExit(
+ LogicalExpression expression, DartType inferredType) {
+ _replaceType(inferredType);
+ }
+
+ void loopAssignmentStatementEnter(ExpressionStatement statement) {
+ _inSynthetic = true;
+ }
+
+ @override
+ void loopAssignmentStatementExit(ExpressionStatement statement) {
+ _inSynthetic = false;
+ }
+
@override
void methodInvocationBeforeArgs(Expression expression, bool isImplicitCall) {
if (!isImplicitCall) {
@@ -372,8 +450,32 @@
}
@override
+ bool staticAssignEnter(
+ Expression expression, Expression write, DartType typeContext) {
+ _deferReference(write.fileOffset);
+ _deferType(write.fileOffset);
+ return super.staticAssignEnter(expression, write, typeContext);
+ }
+
+ @override
+ void staticAssignExit(
+ Expression expression,
+ Expression write,
+ Member writeMember,
+ DartType writeContext,
+ Procedure combiner,
+ DartType inferredType) {
+ _replaceReference(new MemberSetterNode(writeMember));
+ _replaceType(writeContext);
+ _recordReference(
+ combiner ?? const NullNode('assign-combiner'), write.fileOffset);
+ _recordType(inferredType, write.fileOffset);
+ }
+
+ @override
void staticGetExit(StaticGet expression, DartType inferredType) {
- _recordReference(expression.target, expression.fileOffset);
+ _recordReference(
+ new MemberGetterNode(expression.target), expression.fileOffset);
super.staticGetExit(expression, inferredType);
}
@@ -416,6 +518,13 @@
}
@override
+ void stringConcatenationExit(
+ StringConcatenation expression, DartType inferredType) {
+ // We don't need the type - we already know that it is String.
+ // Moreover, the file offset for StringConcatenation is `-1`.
+ }
+
+ @override
void thisExpressionExit(ThisExpression expression, DartType inferredType) {}
void typeLiteralExit(TypeLiteral expression, DartType inferredType) {
@@ -486,27 +595,32 @@
}
void _recordDeclaration(Statement declaration, int offset) {
+ if (_inSynthetic) return;
_declarations.add(declaration);
}
int _recordReference(Node target, int offset) {
+ if (_inSynthetic) return -1;
int slot = _references.length;
_references.add(target);
return slot;
}
int _recordType(DartType type, int offset) {
+ if (_inSynthetic) return -1;
int slot = _types.length;
_types.add(type);
return slot;
}
void _replaceReference(Node reference) {
+ if (_inSynthetic) return;
int slot = _deferredReferenceSlots.removeLast();
_references[slot] = reference;
}
void _replaceType(DartType type, [int newOffset = -1]) {
+ if (_inSynthetic) return;
int slot = _deferredTypeSlots.removeLast();
_types[slot] = type;
}
diff --git a/pkg/analyzer/lib/src/generated/declaration_resolver.dart b/pkg/analyzer/lib/src/generated/declaration_resolver.dart
index b8bd650..87cddaa 100644
--- a/pkg/analyzer/lib/src/generated/declaration_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/declaration_resolver.dart
@@ -154,6 +154,13 @@
_match(normalParameter.identifier, _walker.getParameter());
if (normalParameter is SimpleFormalParameterImpl) {
normalParameter.element = element;
+ if (_applyKernelTypes) {
+ if (normalParameter.type != null) {
+ ResolutionApplier.applyToTypeAnnotation(
+ element.type, normalParameter.type);
+ }
+ node.identifier?.staticType = element.type;
+ }
_setGenericFunctionType(normalParameter.type, element.type);
}
if (normalParameter is FieldFormalParameterImpl) {
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 5ee46d0..1b8b79e 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -1651,6 +1651,7 @@
buffer.addBool(implicitDynamic);
buffer.addBool(strongMode);
buffer.addBool(strongModeHints);
+ buffer.addBool(useFastaParser);
// Append error processors.
buffer.addInt(errorProcessors.length);
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 625b52e..e5b19aa 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -6246,9 +6246,14 @@
TypeParameterTypeImpl.getTypes(genericType.typeFormals);
var typeArgs = typeArgumentList.map((t) => t.type).toList();
- for (int i = 0, len = math.min(typeArgs.length, fnTypeParams.length);
- i < len;
- i++) {
+ // If the amount mismatches, clean up the lists to be substitutable. The
+ // mismatch in size is reported elsewhere, but we must successfully
+ // perform substitution to validate bounds on mismatched lists.
+ final providedLength = math.min(typeArgs.length, fnTypeParams.length);
+ fnTypeParams = fnTypeParams.sublist(0, providedLength);
+ typeArgs = typeArgs.sublist(0, providedLength);
+
+ for (int i = 0; i < providedLength; i++) {
// Check the `extends` clause for the type parameter, if any.
//
// Also substitute to handle cases like this:
diff --git a/pkg/analyzer/lib/src/kernel/resynthesize.dart b/pkg/analyzer/lib/src/kernel/resynthesize.dart
index 105dc52..1914e12 100644
--- a/pkg/analyzer/lib/src/kernel/resynthesize.dart
+++ b/pkg/analyzer/lib/src/kernel/resynthesize.dart
@@ -163,7 +163,7 @@
return classElement.getSetter(elementName) as ElementImpl;
} else if (kind == '@fields') {
return classElement.getField(elementName) as ElementImpl;
- } else if (kind == '@constructors') {
+ } else if (kind == '@constructors' || kind == '@factories') {
if (elementName.isEmpty) {
return classElement.unnamedConstructor as ElementImpl;
}
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart
index bfb68f1..0b6dc66 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart
@@ -23,7 +23,10 @@
@override
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/30985')
+ // This test fails because the kernel driver element model produces a
+ // different element model result than the regular parser produces. Once these
+ // tests enable the faster parser (and not just the kernel driver), this
+ // should be looked at again.
test_bug_23176() async {
return super.test_bug_23176();
}
@@ -228,6 +231,13 @@
@override
@failingTest
+ test_nonConstValueInInitializer_instanceCreation_inDifferentFile() {
+ return super
+ .test_nonConstValueInInitializer_instanceCreation_inDifferentFile();
+ }
+
+ @override
+ @failingTest
@potentialAnalyzerProblem
test_prefix_conditionalPropertyAccess_get_loadLibrary() async {
return super.test_prefix_conditionalPropertyAccess_get_loadLibrary();
diff --git a/pkg/analyzer/test/generated/parser_fasta_test.dart b/pkg/analyzer/test/generated/parser_fasta_test.dart
index 391bf75..7b0feb7 100644
--- a/pkg/analyzer/test/generated/parser_fasta_test.dart
+++ b/pkg/analyzer/test/generated/parser_fasta_test.dart
@@ -1354,14 +1354,6 @@
@override
@failingTest
- void test_namedParameterOutsideGroup() {
- // TODO(brianwilkerson) Wrong errors:
- // Expected 1 errors of type ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, found 0
- super.test_namedParameterOutsideGroup();
- }
-
- @override
- @failingTest
void test_nonConstructorFactory_field() {
// TODO(brianwilkerson) Does not recover.
// Internal problem: Compiler cannot run without a compiler context.
@@ -1710,14 +1702,6 @@
}
@override
- @failingTest
- void test_useOfUnaryPlusOperator() {
- // TODO(brianwilkerson) Wrong errors:
- // Expected 1 errors of type ParserErrorCode.MISSING_IDENTIFIER, found 0
- super.test_useOfUnaryPlusOperator();
- }
-
- @override
void test_varAndType_local() {
// The inherited test is marked as failing.
super.test_varAndType_local();
@@ -2587,62 +2571,12 @@
with RecoveryParserTestMixin {
@override
@failingTest
- void test_additiveExpression_missing_LHS() {
- // TODO(brianwilkerson) Unhandled compile-time error:
- // '+' is not a prefix operator.
- super.test_additiveExpression_missing_LHS();
- }
-
- @override
- @failingTest
- void test_additiveExpression_missing_LHS_RHS() {
- // TODO(brianwilkerson) Unhandled compile-time error:
- // '+' is not a prefix operator.
- super.test_additiveExpression_missing_LHS_RHS();
- }
-
- @override
- @failingTest
- void test_additiveExpression_precedence_multiplicative_left() {
- // TODO(brianwilkerson) reportUnrecoverableErrorWithToken
- super.test_additiveExpression_precedence_multiplicative_left();
- }
-
- @override
- @failingTest
- void test_additiveExpression_precedence_multiplicative_right() {
- // TODO(brianwilkerson) Unhandled compile-time error:
- // '+' is not a prefix operator.
- super.test_additiveExpression_precedence_multiplicative_right();
- }
-
- @override
- @failingTest
- void test_additiveExpression_super() {
- // TODO(brianwilkerson) Unhandled compile-time error:
- // '+' is not a prefix operator.
- super.test_additiveExpression_super();
- }
-
- @override
- @failingTest
void test_classTypeAlias_withBody() {
// TODO(brianwilkerson) reportUnrecoverableErrorWithToken
super.test_classTypeAlias_withBody();
}
@override
- void test_equalityExpression_precedence_relational_left() {
- // Fasta recovers differently. It takes the `is` to be an identifier and
- // assumes that the right operand of the `==` is the only missing identifier.
- parseExpression("is ==", codes: [
-// ParserErrorCode.EXPECTED_TYPE_NAME,
- ParserErrorCode.MISSING_IDENTIFIER,
- ParserErrorCode.MISSING_IDENTIFIER
- ]);
- }
-
- @override
void test_equalityExpression_precedence_relational_right() {
// Fasta recovers differently. It takes the `is` to be an identifier and
// assumes that it is the right operand of the `==`.
@@ -2911,29 +2845,6 @@
ParserErrorCode.MISSING_IDENTIFIER
]);
}
-
- @override
- @failingTest
- void test_shiftExpression_precedence_unary_left() {
- // TODO(brianwilkerson) Unhandled compile-time error:
- // '+' is not a prefix operator.
- super.test_shiftExpression_precedence_unary_left();
- }
-
- @override
- @failingTest
- void test_shiftExpression_precedence_unary_right() {
- // TODO(brianwilkerson) reportUnrecoverableErrorWithToken
- super.test_shiftExpression_precedence_unary_right();
- }
-
- @override
- @failingTest
- void test_unaryPlus() {
- // TODO(brianwilkerson) Unhandled compile-time error:
- // '+' is not a prefix operator.
- super.test_unaryPlus();
- }
}
/**
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 39121f4..0520f0b 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -4945,8 +4945,16 @@
expectNotNullIfNoErrors(expression);
listener.assertErrors(
[expectedError(ParserErrorCode.MISSING_IDENTIFIER, 0, 1)]);
- var identifier = expression as SimpleIdentifier;
- expect(identifier.isSynthetic, isTrue);
+ if (usingFastaParser) {
+ BinaryExpression binaryExpression = expression;
+ expect(binaryExpression.leftOperand.isSynthetic, isTrue);
+ expect(binaryExpression.rightOperand.isSynthetic, isFalse);
+ SimpleIdentifier identifier = binaryExpression.rightOperand;
+ expect(identifier.name, 'x');
+ } else {
+ var identifier = expression as SimpleIdentifier;
+ expect(identifier.isSynthetic, isTrue);
+ }
}
void test_varAndType_field() {
@@ -9901,6 +9909,13 @@
class B = Object with A {}''', codes: [ParserErrorCode.EXPECTED_TOKEN]);
}
+ void test_combinator_missingIdentifier() {
+ createParser('import "/testB.dart" show ;');
+ parser.parseCompilationUnit2();
+ listener.assertErrors(
+ [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 26, 1)]);
+ }
+
void test_conditionalExpression_missingElse() {
Expression expression =
parseExpression('x ? y :', codes: [ParserErrorCode.MISSING_IDENTIFIER]);
@@ -9972,13 +9987,24 @@
}
void test_equalityExpression_precedence_relational_left() {
- BinaryExpression expression = parseExpression("is ==", codes: [
- ParserErrorCode.EXPECTED_TYPE_NAME,
- ParserErrorCode.MISSING_IDENTIFIER,
- ParserErrorCode.MISSING_IDENTIFIER
- ]);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is IsExpression, IsExpression, expression.leftOperand);
+ // Fasta recovers differently. It takes the `is` to be an identifier and
+ // assumes that the right operand of `==` is the only missing identifier.
+ BinaryExpression expression = parseExpression("is ==",
+ codes: usingFastaParser
+ ? [
+ //ParserErrorCode.EXPECTED_TYPE_NAME,
+ ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.MISSING_IDENTIFIER
+ ]
+ : [
+ ParserErrorCode.EXPECTED_TYPE_NAME,
+ ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.MISSING_IDENTIFIER
+ ]);
+ if (!usingFastaParser) {
+ EngineTestCase.assertInstanceOf(
+ (obj) => obj is IsExpression, IsExpression, expression.leftOperand);
+ }
}
void test_equalityExpression_precedence_relational_right() {
@@ -10063,6 +10089,16 @@
parseExpression("m(f() => 0);", codes: [ParserErrorCode.EXPECTED_TOKEN]);
}
+ void test_ifStatement_noElse_statement() {
+ parseStatement('if (x v) f(x);');
+ listener.assertErrors(usingFastaParser
+ ? [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 6, 1)]
+ : [
+ expectedError(ParserErrorCode.EXPECTED_TOKEN, 6, 1),
+ expectedError(ParserErrorCode.EXPECTED_TOKEN, 6, 1)
+ ]);
+ }
+
void test_importDirectivePartial_as() {
CompilationUnit unit = parseCompilationUnit("import 'b.dart' d as b;",
codes: [ParserErrorCode.UNEXPECTED_TOKEN]);
@@ -10531,6 +10567,11 @@
BinaryExpression, expression.rightOperand);
}
+ void test_method_missingBody() {
+ parseCompilationUnit("class C { b() }",
+ errors: [expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 14, 1)]);
+ }
+
void test_missing_commaInArgumentList() {
parseExpression("f(x: 1 y: 2)",
codes: usingFastaParser
@@ -10679,6 +10720,23 @@
BinaryExpression, expression.leftOperand);
}
+ void test_namedParameterOutsideGroup() {
+ CompilationUnit unit =
+ parseCompilationUnit('class A { b(c: 0, Foo d: 0, e){} }', errors: [
+ expectedError(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, 13, 1),
+ expectedError(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, 23, 1)
+ ]);
+ expect(unit.declarations, hasLength(1));
+ ClassDeclaration classA = unit.declarations[0];
+ expect(classA.members, hasLength(1));
+ MethodDeclaration method = classA.members[0];
+ NodeList<FormalParameter> parameters = method.parameters.parameters;
+ expect(parameters, hasLength(3));
+ expect(parameters[0].kind, ParameterKind.NAMED);
+ expect(parameters[1].kind, ParameterKind.NAMED);
+ expect(parameters[2].kind, ParameterKind.REQUIRED);
+ }
+
void test_nonStringLiteralUri_import() {
parseCompilationUnit("import dart:io; class C {}",
codes: [ParserErrorCode.NON_STRING_LITERAL_AS_URI]);
@@ -15768,6 +15826,68 @@
expect(functionExpression.body, isNotNull);
}
+ void test_parseFunctionDeclaration_metadata() {
+ createParser(
+ 'T f(@A a, @B(2) Foo b, {@C.foo(3) c : 0, @d.E.bar(4, 5) x:0}) {}');
+ FunctionDeclaration declaration = parseFullCompilationUnitMember();
+ expect(declaration, isNotNull);
+ assertNoErrors();
+ expect(declaration.documentationComment, isNull);
+ expect((declaration.returnType as TypeName).name.name, 'T');
+ expect(declaration.name, isNotNull);
+ FunctionExpression expression = declaration.functionExpression;
+ expect(expression, isNotNull);
+ expect(expression.body, isNotNull);
+ expect(expression.typeParameters, isNull);
+ NodeList<FormalParameter> parameters = expression.parameters.parameters;
+ expect(parameters, hasLength(4));
+ expect(declaration.propertyKeyword, isNull);
+
+ {
+ var annotation = parameters[0].metadata[0];
+ expect(annotation.atSign, isNotNull);
+ expect(annotation.name, new isInstanceOf<SimpleIdentifier>());
+ expect(annotation.name.name, 'A');
+ expect(annotation.period, isNull);
+ expect(annotation.constructorName, isNull);
+ expect(annotation.arguments, isNull);
+ }
+
+ {
+ var annotation = parameters[1].metadata[0];
+ expect(annotation.atSign, isNotNull);
+ expect(annotation.name, new isInstanceOf<SimpleIdentifier>());
+ expect(annotation.name.name, 'B');
+ expect(annotation.period, isNull);
+ expect(annotation.constructorName, isNull);
+ expect(annotation.arguments, isNotNull);
+ expect(annotation.arguments.arguments, hasLength(1));
+ }
+
+ {
+ var annotation = parameters[2].metadata[0];
+ expect(annotation.atSign, isNotNull);
+ expect(annotation.name, new isInstanceOf<PrefixedIdentifier>());
+ expect(annotation.name.name, 'C.foo');
+ expect(annotation.period, isNull);
+ expect(annotation.constructorName, isNull);
+ expect(annotation.arguments, isNotNull);
+ expect(annotation.arguments.arguments, hasLength(1));
+ }
+
+ {
+ var annotation = parameters[3].metadata[0];
+ expect(annotation.atSign, isNotNull);
+ expect(annotation.name, new isInstanceOf<PrefixedIdentifier>());
+ expect(annotation.name.name, 'd.E');
+ expect(annotation.period, isNotNull);
+ expect(annotation.constructorName, isNotNull);
+ expect(annotation.constructorName.name, 'bar');
+ expect(annotation.arguments, isNotNull);
+ expect(annotation.arguments.arguments, hasLength(2));
+ }
+ }
+
void test_parseFunctionDeclaration_setter() {
createParser('/// Doc\nT set p(v) {}');
FunctionDeclaration declaration = parseFullCompilationUnitMember();
diff --git a/pkg/analyzer/test/generated/strong_mode_test.dart b/pkg/analyzer/test/generated/strong_mode_test.dart
index 1441978..80f5c2b 100644
--- a/pkg/analyzer/test/generated/strong_mode_test.dart
+++ b/pkg/analyzer/test/generated/strong_mode_test.dart
@@ -3441,6 +3441,22 @@
expectIdentifierType('paramTearOff', "<T>(T) → T");
}
+ test_genericMethod_partiallyAppliedErrorWithBound() async {
+ await resolveTestUnit(r'''
+void f<X extends List, Y>() => null;
+
+void test() {
+ f<int>();
+}
+''', noErrors: false);
+ assertErrors(testSource, [
+ // Make sure to catch both the missing parameter:
+ StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD,
+ // And the incorrect parameter:
+ StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
+ ]);
+ }
+
test_genericMethod_then() async {
String code = r'''
import 'dart:async';
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_kernel_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_kernel_test.dart
index 234d071..bfda882 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_kernel_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_kernel_test.dart
@@ -62,6 +62,13 @@
@failingTest
@potentialAnalyzerProblem
@override
+ test_const_annotation_notConstConstructor() async {
+ await super.test_const_annotation_notConstConstructor();
+ }
+
+ @failingTest
+ @potentialAnalyzerProblem
+ @override
test_const_annotation_withArgs() async {
await super.test_const_annotation_withArgs();
}
@@ -81,7 +88,7 @@
}
@failingTest
- @potentialAnalyzerProblem
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/31555')
@override
test_const_implicitSuperConstructorInvocation() async {
await super.test_const_implicitSuperConstructorInvocation();
@@ -137,13 +144,6 @@
@failingTest
@potentialAnalyzerProblem
@override
- test_getResult_constants_defaultParameterValue_localFunction() async {
- await super.test_getResult_constants_defaultParameterValue_localFunction();
- }
-
- @failingTest
- @potentialAnalyzerProblem
- @override
test_getResult_errors() async {
await super.test_getResult_errors();
}
@@ -151,13 +151,6 @@
@failingTest
@potentialAnalyzerProblem
@override
- test_getResult_genericFunctionType_parameter_named() async {
- await super.test_getResult_genericFunctionType_parameter_named();
- }
-
- @failingTest
- @potentialAnalyzerProblem
- @override
test_getResult_importLibrary_thenRemoveIt() async {
await super.test_getResult_importLibrary_thenRemoveIt();
}
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index f76b383..84e174d 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -68,155 +68,142 @@
*/
@reflectiveTest
class AnalysisDriverResolutionTest extends BaseAnalysisDriverTest {
- test_apply_instanceCreation_noTypeArguments() async {
+ test_adjacentStrings() async {
String content = r'''
-class C {
- C(int p);
- C.named(int p);
+void main() {
+ 'aaa' 'bbb' 'ccc';
}
-var a = new C(1);
-var b = new C.named(2);
+''';
+ addTestFile(content);
+ AnalysisResult result = await driver.getResult(testFile);
+ var typeProvider = result.unit.element.context.typeProvider;
+
+ List<Statement> statements = _getMainStatements(result);
+
+ ExpressionStatement statement = statements[0];
+ AdjacentStrings expression = statement.expression;
+ expect(expression.staticType, typeProvider.stringType);
+ expect(expression.strings, hasLength(3));
+
+ StringLiteral literal_1 = expression.strings[0];
+ expect(literal_1.staticType, typeProvider.stringType);
+
+ StringLiteral literal_2 = expression.strings[1];
+ expect(literal_2.staticType, typeProvider.stringType);
+
+ StringLiteral literal_3 = expression.strings[2];
+ expect(literal_3.staticType, typeProvider.stringType);
+ }
+
+ test_annotation() async {
+ String content = r'''
+const myAnnotation = 1;
+
+@myAnnotation
+class C {
+ @myAnnotation
+ int field = 2;
+
+ @myAnnotation
+ C() {}
+
+ @myAnnotation
+ void method() {}
+}
+
+@myAnnotation
+int topLevelVariable = 3;
+
+@myAnnotation
+void topLevelFunction() {}
''';
addTestFile(content);
AnalysisResult result = await driver.getResult(testFile);
- CompilationUnit unit = result.unit;
+ var typeProvider = result.unit.element.context.typeProvider;
- ClassDeclaration cNode = unit.declarations[0];
- ClassElement cElement = cNode.element;
- ConstructorElement defaultConstructor = cElement.constructors[0];
- ConstructorElement namedConstructor = cElement.constructors[1];
+ TopLevelVariableDeclaration myDeclaration = result.unit.declarations[0];
+ VariableDeclaration myVariable = myDeclaration.variables.variables[0];
+ TopLevelVariableElement myElement = myVariable.element;
- {
- TopLevelVariableDeclaration aDeclaration = unit.declarations[1];
- VariableDeclaration aNode = aDeclaration.variables.variables[0];
- InstanceCreationExpression value = aNode.initializer;
- expect(value.staticElement, defaultConstructor);
- expect(value.staticType, cElement.type);
+ void assertMyAnnotation(AnnotatedNode node) {
+ Annotation annotation = node.metadata[0];
+ expect(annotation.element, same(myElement.getter));
- TypeName typeName = value.constructorName.type;
- expect(typeName.typeArguments, isNull);
-
- Identifier typeIdentifier = typeName.name;
- expect(typeIdentifier.staticElement, cElement);
- expect(typeIdentifier.staticType, cElement.type);
-
- expect(value.constructorName.name, isNull);
-
- Expression argument = value.argumentList.arguments[0];
- expect(argument.staticParameterElement, defaultConstructor.parameters[0]);
+ SimpleIdentifier identifier_1 = annotation.name;
+ expect(identifier_1.staticElement, same(myElement.getter));
+ expect(identifier_1.staticType, typeProvider.intType);
}
{
- TopLevelVariableDeclaration bDeclaration = unit.declarations[2];
- VariableDeclaration bNode = bDeclaration.variables.variables[0];
- InstanceCreationExpression value = bNode.initializer;
- expect(value.staticElement, namedConstructor);
- expect(value.staticType, cElement.type);
+ ClassDeclaration classNode = result.unit.declarations[1];
+ assertMyAnnotation(classNode);
- TypeName typeName = value.constructorName.type;
- expect(typeName.typeArguments, isNull);
+ {
+ FieldDeclaration node = classNode.members[0];
+ assertMyAnnotation(node);
+ }
- SimpleIdentifier typeIdentifier = typeName.name;
- expect(typeIdentifier.staticElement, cElement);
- expect(typeIdentifier.staticType, cElement.type);
+ {
+ ConstructorDeclaration node = classNode.members[1];
+ assertMyAnnotation(node);
+ }
- SimpleIdentifier constructorName = value.constructorName.name;
- expect(constructorName.staticElement, namedConstructor);
- expect(constructorName.staticType, isNull);
+ {
+ MethodDeclaration node = classNode.members[2];
+ assertMyAnnotation(node);
+ }
+ }
- Expression argument = value.argumentList.arguments[0];
- expect(argument.staticParameterElement, namedConstructor.parameters[0]);
+ {
+ TopLevelVariableDeclaration node = result.unit.declarations[2];
+ assertMyAnnotation(node);
+ }
+
+ {
+ FunctionDeclaration node = result.unit.declarations[3];
+ assertMyAnnotation(node);
}
}
- test_apply_instanceCreation_withTypeArguments() async {
+ test_annotation_kind_reference() async {
String content = r'''
-class C<K, V> {
- C(K k, V v);
- C.named(K k, V v);
+const annotation_1 = 1;
+const annotation_2 = 1;
+@annotation_1
+@annotation_2
+void main() {
+ print(42);
}
-var a = new C<int, double>(1, 2.3);
-var b = new C<num, String>.named(4, 'five');
''';
addTestFile(content);
AnalysisResult result = await driver.getResult(testFile);
- CompilationUnit unit = result.unit;
- var typeProvider = unit.element.context.typeProvider;
+ var typeProvider = result.unit.element.context.typeProvider;
- ClassDeclaration cNode = unit.declarations[0];
- ClassElement cElement = cNode.element;
- ConstructorElement defaultConstructor = cElement.constructors[0];
- ConstructorElement namedConstructor = cElement.constructors[1];
+ TopLevelVariableDeclaration declaration_1 = result.unit.declarations[0];
+ VariableDeclaration variable_1 = declaration_1.variables.variables[0];
+ TopLevelVariableElement element_1 = variable_1.element;
- {
- TopLevelVariableDeclaration aDeclaration = unit.declarations[1];
- VariableDeclaration aNode = aDeclaration.variables.variables[0];
+ TopLevelVariableDeclaration declaration_2 = result.unit.declarations[1];
+ VariableDeclaration variable_2 = declaration_2.variables.variables[0];
+ TopLevelVariableElement element_2 = variable_2.element;
- InstanceCreationExpression value = aNode.initializer;
- InterfaceType instantiatedType = cElement.type
- .instantiate([typeProvider.intType, typeProvider.doubleType]);
+ FunctionDeclaration main = result.unit.declarations[2];
- expect(value.staticElement, defaultConstructor);
- expect(value.staticType, instantiatedType);
+ Annotation annotation_1 = main.metadata[0];
+ expect(annotation_1.element, same(element_1.getter));
- TypeName typeName = value.constructorName.type;
+ SimpleIdentifier identifier_1 = annotation_1.name;
+ expect(identifier_1.staticElement, same(element_1.getter));
+ expect(identifier_1.staticType, typeProvider.intType);
- Identifier typeIdentifier = typeName.name;
- expect(typeIdentifier.staticElement, cElement);
- expect(typeIdentifier.staticType, instantiatedType);
+ Annotation annotation_2 = main.metadata[1];
+ expect(annotation_2.element, same(element_2.getter));
- TypeName typeArgument1 = typeName.typeArguments.arguments[0];
- expect(typeArgument1.type, typeProvider.intType);
- expect(typeArgument1.name.staticType, typeProvider.intType);
- expect(typeArgument1.name.staticElement, typeProvider.intType.element);
-
- TypeName typeArgument2 = typeName.typeArguments.arguments[1];
- expect(typeArgument2.type, typeProvider.doubleType);
- expect(typeArgument2.name.staticType, typeProvider.doubleType);
- expect(typeArgument2.name.staticElement, typeProvider.doubleType.element);
-
- expect(value.constructorName.name, isNull);
-
- Expression argument = value.argumentList.arguments[0];
- expect(argument.staticParameterElement, defaultConstructor.parameters[0]);
- }
-
- {
- TopLevelVariableDeclaration bDeclaration = unit.declarations[2];
- VariableDeclaration bNode = bDeclaration.variables.variables[0];
-
- InstanceCreationExpression value = bNode.initializer;
- InterfaceType instantiatedType = cElement.type
- .instantiate([typeProvider.numType, typeProvider.stringType]);
-
- expect(value.staticElement, namedConstructor);
- expect(value.staticType, instantiatedType);
-
- TypeName typeName = value.constructorName.type;
-
- SimpleIdentifier typeIdentifier = typeName.name;
- expect(typeIdentifier.staticElement, cElement);
- expect(typeIdentifier.staticType, instantiatedType);
-
- TypeName typeArgument1 = typeName.typeArguments.arguments[0];
- expect(typeArgument1.type, typeProvider.numType);
- expect(typeArgument1.name.staticType, typeProvider.numType);
- expect(typeArgument1.name.staticElement, typeProvider.numType.element);
-
- TypeName typeArgument2 = typeName.typeArguments.arguments[1];
- expect(typeArgument2.type, typeProvider.stringType);
- expect(typeArgument2.name.staticType, typeProvider.stringType);
- expect(typeArgument2.name.staticElement, typeProvider.stringType.element);
-
- SimpleIdentifier constructorName = value.constructorName.name;
- expect(constructorName.staticElement, namedConstructor);
- expect(constructorName.staticType, isNull);
-
- Expression argument = value.argumentList.arguments[0];
- expect(argument.staticParameterElement, namedConstructor.parameters[0]);
- }
+ SimpleIdentifier identifier_2 = annotation_2.name;
+ expect(identifier_2.staticElement, same(element_2.getter));
+ expect(identifier_2.staticType, typeProvider.intType);
}
test_asExpression() async {
@@ -538,6 +525,44 @@
}
}
+ test_assignmentExpression_simple_instanceField_unqualified() async {
+ String content = r'''
+class C {
+ num f = 0;
+ foo() {
+ f = 2;
+ }
+}
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ ClassDeclaration cDeclaration = unit.declarations[0];
+ FieldElement fElement = cDeclaration.element.fields[0];
+
+ MethodDeclaration fooDeclaration = cDeclaration.members[1];
+ BlockFunctionBody fooBody = fooDeclaration.body;
+
+ {
+ ExpressionStatement statement = fooBody.block.statements[0];
+
+ AssignmentExpression assignment = statement.expression;
+ expect(assignment.operator.type, TokenType.EQ);
+ expect(assignment.staticElement, isNull);
+ expect(assignment.staticType, typeProvider.intType);
+
+ SimpleIdentifier left = assignment.leftHandSide;
+ expect(left.staticElement, same(fElement.setter));
+ expect(left.staticType, typeProvider.numType);
+
+ Expression right = assignment.rightHandSide;
+ expect(right.staticType, typeProvider.intType);
+ }
+ }
+
test_assignmentExpression_simple_local() async {
String content = r'''
main() {
@@ -627,6 +652,48 @@
}
}
+ test_assignmentExpression_simple_prefixedIdentifier_staticField() async {
+ String content = r'''
+main() {
+ C.f = 2;
+}
+class C {
+ static num f;
+}
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ ClassDeclaration cClassDeclaration = unit.declarations[1];
+ ClassElement cClassElement = cClassDeclaration.element;
+ FieldElement fElement = cClassElement.getField('f');
+
+ List<Statement> mainStatements = _getMainStatements(result);
+
+ {
+ ExpressionStatement statement = mainStatements[0];
+
+ AssignmentExpression assignment = statement.expression;
+ expect(assignment.staticType, typeProvider.intType);
+
+ PrefixedIdentifier left = assignment.leftHandSide;
+ expect(left.staticElement, same(fElement.setter));
+ expect(left.staticType, typeProvider.numType);
+
+ expect(left.prefix.staticElement, cClassElement);
+ expect(left.prefix.staticType, cClassElement.type);
+
+ expect(left.identifier.staticElement, same(fElement.setter));
+ expect(left.identifier.staticType, typeProvider.numType);
+
+ Expression right = assignment.rightHandSide;
+ expect(right.staticType, typeProvider.intType);
+ }
+ }
+
test_assignmentExpression_simple_propertyAccess() async {
String content = r'''
main() {
@@ -771,6 +838,82 @@
}
}
+ test_assignmentExpression_simple_staticField_unqualified() async {
+ String content = r'''
+class C {
+ static num f = 0;
+ foo() {
+ f = 2;
+ }
+}
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ ClassDeclaration cDeclaration = unit.declarations[0];
+ FieldElement fElement = cDeclaration.element.fields[0];
+
+ MethodDeclaration fooDeclaration = cDeclaration.members[1];
+ BlockFunctionBody fooBody = fooDeclaration.body;
+
+ {
+ ExpressionStatement statement = fooBody.block.statements[0];
+
+ AssignmentExpression assignment = statement.expression;
+ expect(assignment.operator.type, TokenType.EQ);
+ expect(assignment.staticElement, isNull);
+ expect(assignment.staticType, typeProvider.intType);
+
+ SimpleIdentifier left = assignment.leftHandSide;
+ expect(left.staticElement, same(fElement.setter));
+ expect(left.staticType, typeProvider.numType);
+
+ Expression right = assignment.rightHandSide;
+ expect(right.staticType, typeProvider.intType);
+ }
+ }
+
+ test_assignmentExpression_simple_topLevelVariable() async {
+ String content = r'''
+main() {
+ v = 2;
+}
+num v = 0;
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ TopLevelVariableElement v;
+ {
+ TopLevelVariableDeclaration declaration = unit.declarations[1];
+ v = declaration.variables.variables[0].element;
+ expect(v.type, typeProvider.numType);
+ }
+
+ List<Statement> mainStatements = _getMainStatements(result);
+ {
+ ExpressionStatement statement = mainStatements[0];
+
+ AssignmentExpression assignment = statement.expression;
+ expect(assignment.operator.type, TokenType.EQ);
+ expect(assignment.staticElement, isNull);
+ expect(assignment.staticType, typeProvider.intType);
+
+ SimpleIdentifier left = assignment.leftHandSide;
+ expect(left.staticElement, same(v.setter));
+ expect(left.staticType, typeProvider.numType);
+
+ Expression right = assignment.rightHandSide;
+ expect(right.staticType, typeProvider.intType);
+ }
+ }
+
test_binaryExpression() async {
String content = r'''
main() {
@@ -797,8 +940,58 @@
expect(value.staticType, typeProvider.intType);
}
+ test_binaryExpression_ifNull() async {
+ String content = r'''
+main() {
+ 1.2 ?? 3;
+}
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ List<Statement> mainStatements = _getMainStatements(result);
+
+ ExpressionStatement statement = mainStatements[0];
+ BinaryExpression binary = statement.expression;
+ expect(binary.operator.type, TokenType.QUESTION_QUESTION);
+ expect(binary.staticElement, isNull);
+ expect(binary.staticType, typeProvider.numType);
+
+ expect(binary.leftOperand.staticType, typeProvider.doubleType);
+ expect(binary.rightOperand.staticType, typeProvider.intType);
+ }
+
+ test_binaryExpression_logical() async {
+ addTestFile(r'''
+main() {
+ true && true;
+ true || true;
+}
+''');
+ AnalysisResult result = await driver.getResult(testFile);
+ var typeProvider = result.unit.element.context.typeProvider;
+
+ List<Statement> statements = _getMainStatements(result);
+
+ {
+ ExpressionStatement statement = statements[0];
+ BinaryExpression binaryExpression = statement.expression;
+ expect(binaryExpression.staticElement, isNull);
+ expect(binaryExpression.staticType, typeProvider.boolType);
+ }
+
+ {
+ ExpressionStatement statement = statements[1];
+ BinaryExpression binaryExpression = statement.expression;
+ expect(binaryExpression.staticElement, isNull);
+ expect(binaryExpression.staticType, typeProvider.boolType);
+ }
+ }
+
test_binaryExpression_notEqual() async {
- // TODO(scheglov) Add similar test for `v is! T`.
String content = r'''
main() {
1 != 2;
@@ -906,6 +1099,213 @@
expect(actualElement.parameters[0].type, intType);
}
+ test_instanceCreation_factory() async {
+ String content = r'''
+class C {
+ factory C() => null;
+ factory C.named() => null;
+}
+var a = new C();
+var b = new C.named();
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+
+ ClassDeclaration cNode = unit.declarations[0];
+ ClassElement cElement = cNode.element;
+ ConstructorElement defaultConstructor = cElement.constructors[0];
+ ConstructorElement namedConstructor = cElement.constructors[1];
+
+ {
+ TopLevelVariableDeclaration aDeclaration = unit.declarations[1];
+ VariableDeclaration aNode = aDeclaration.variables.variables[0];
+ InstanceCreationExpression value = aNode.initializer;
+ expect(value.staticElement, defaultConstructor);
+ expect(value.staticType, cElement.type);
+
+ TypeName typeName = value.constructorName.type;
+ expect(typeName.typeArguments, isNull);
+
+ Identifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, cElement);
+ expect(typeIdentifier.staticType, cElement.type);
+
+ expect(value.constructorName.name, isNull);
+ }
+
+ {
+ TopLevelVariableDeclaration bDeclaration = unit.declarations[2];
+ VariableDeclaration bNode = bDeclaration.variables.variables[0];
+ InstanceCreationExpression value = bNode.initializer;
+ expect(value.staticElement, namedConstructor);
+ expect(value.staticType, cElement.type);
+
+ TypeName typeName = value.constructorName.type;
+ expect(typeName.typeArguments, isNull);
+
+ SimpleIdentifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, cElement);
+ expect(typeIdentifier.staticType, cElement.type);
+
+ SimpleIdentifier constructorName = value.constructorName.name;
+ expect(constructorName.staticElement, namedConstructor);
+ expect(constructorName.staticType, isNull);
+ }
+ }
+
+ test_instanceCreation_noTypeArguments() async {
+ String content = r'''
+class C {
+ C(int p);
+ C.named(int p);
+}
+var a = new C(1);
+var b = new C.named(2);
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+
+ ClassDeclaration cNode = unit.declarations[0];
+ ClassElement cElement = cNode.element;
+ ConstructorElement defaultConstructor = cElement.constructors[0];
+ ConstructorElement namedConstructor = cElement.constructors[1];
+
+ {
+ TopLevelVariableDeclaration aDeclaration = unit.declarations[1];
+ VariableDeclaration aNode = aDeclaration.variables.variables[0];
+ InstanceCreationExpression value = aNode.initializer;
+ expect(value.staticElement, defaultConstructor);
+ expect(value.staticType, cElement.type);
+
+ TypeName typeName = value.constructorName.type;
+ expect(typeName.typeArguments, isNull);
+
+ Identifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, cElement);
+ expect(typeIdentifier.staticType, cElement.type);
+
+ expect(value.constructorName.name, isNull);
+
+ Expression argument = value.argumentList.arguments[0];
+ expect(argument.staticParameterElement, defaultConstructor.parameters[0]);
+ }
+
+ {
+ TopLevelVariableDeclaration bDeclaration = unit.declarations[2];
+ VariableDeclaration bNode = bDeclaration.variables.variables[0];
+ InstanceCreationExpression value = bNode.initializer;
+ expect(value.staticElement, namedConstructor);
+ expect(value.staticType, cElement.type);
+
+ TypeName typeName = value.constructorName.type;
+ expect(typeName.typeArguments, isNull);
+
+ SimpleIdentifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, cElement);
+ expect(typeIdentifier.staticType, cElement.type);
+
+ SimpleIdentifier constructorName = value.constructorName.name;
+ expect(constructorName.staticElement, namedConstructor);
+ expect(constructorName.staticType, isNull);
+
+ Expression argument = value.argumentList.arguments[0];
+ expect(argument.staticParameterElement, namedConstructor.parameters[0]);
+ }
+ }
+
+ test_instanceCreation_withTypeArguments() async {
+ String content = r'''
+class C<K, V> {
+ C(K k, V v);
+ C.named(K k, V v);
+}
+var a = new C<int, double>(1, 2.3);
+var b = new C<num, String>.named(4, 'five');
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ ClassDeclaration cNode = unit.declarations[0];
+ ClassElement cElement = cNode.element;
+ ConstructorElement defaultConstructor = cElement.constructors[0];
+ ConstructorElement namedConstructor = cElement.constructors[1];
+
+ {
+ TopLevelVariableDeclaration aDeclaration = unit.declarations[1];
+ VariableDeclaration aNode = aDeclaration.variables.variables[0];
+
+ InstanceCreationExpression value = aNode.initializer;
+ InterfaceType instantiatedType = cElement.type
+ .instantiate([typeProvider.intType, typeProvider.doubleType]);
+
+ expect(value.staticElement, defaultConstructor);
+ expect(value.staticType, instantiatedType);
+
+ TypeName typeName = value.constructorName.type;
+
+ Identifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, cElement);
+ expect(typeIdentifier.staticType, instantiatedType);
+
+ TypeName typeArgument1 = typeName.typeArguments.arguments[0];
+ expect(typeArgument1.type, typeProvider.intType);
+ expect(typeArgument1.name.staticType, typeProvider.intType);
+ expect(typeArgument1.name.staticElement, typeProvider.intType.element);
+
+ TypeName typeArgument2 = typeName.typeArguments.arguments[1];
+ expect(typeArgument2.type, typeProvider.doubleType);
+ expect(typeArgument2.name.staticType, typeProvider.doubleType);
+ expect(typeArgument2.name.staticElement, typeProvider.doubleType.element);
+
+ expect(value.constructorName.name, isNull);
+
+ Expression argument = value.argumentList.arguments[0];
+ expect(argument.staticParameterElement, defaultConstructor.parameters[0]);
+ }
+
+ {
+ TopLevelVariableDeclaration bDeclaration = unit.declarations[2];
+ VariableDeclaration bNode = bDeclaration.variables.variables[0];
+
+ InstanceCreationExpression value = bNode.initializer;
+ InterfaceType instantiatedType = cElement.type
+ .instantiate([typeProvider.numType, typeProvider.stringType]);
+
+ expect(value.staticElement, namedConstructor);
+ expect(value.staticType, instantiatedType);
+
+ TypeName typeName = value.constructorName.type;
+
+ SimpleIdentifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, cElement);
+ expect(typeIdentifier.staticType, instantiatedType);
+
+ TypeName typeArgument1 = typeName.typeArguments.arguments[0];
+ expect(typeArgument1.type, typeProvider.numType);
+ expect(typeArgument1.name.staticType, typeProvider.numType);
+ expect(typeArgument1.name.staticElement, typeProvider.numType.element);
+
+ TypeName typeArgument2 = typeName.typeArguments.arguments[1];
+ expect(typeArgument2.type, typeProvider.stringType);
+ expect(typeArgument2.name.staticType, typeProvider.stringType);
+ expect(typeArgument2.name.staticElement, typeProvider.stringType.element);
+
+ SimpleIdentifier constructorName = value.constructorName.name;
+ expect(constructorName.staticElement, namedConstructor);
+ expect(constructorName.staticType, isNull);
+
+ Expression argument = value.argumentList.arguments[0];
+ expect(argument.staticParameterElement, namedConstructor.parameters[0]);
+ }
+ }
+
test_isExpression() async {
String content = r'''
void main() {
@@ -929,10 +1329,51 @@
vElement = statement.variables.variables[0].name.staticElement;
}
- // v;
+ // v is num;
{
ExpressionStatement statement = statements[1];
IsExpression isExpression = statement.expression;
+ expect(isExpression.notOperator, isNull);
+ expect(isExpression.staticType, typeProvider.boolType);
+
+ SimpleIdentifier target = isExpression.expression;
+ expect(target.staticElement, vElement);
+ expect(target.staticType, typeProvider.intType);
+
+ TypeName numName = isExpression.type;
+ expect(numName.name.staticElement, typeProvider.numType.element);
+ expect(numName.name.staticType, typeProvider.numType);
+ }
+ }
+
+ test_isExpression_not() async {
+ String content = r'''
+void main() {
+ var v = 42;
+ v is! num;
+}
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ expect(result.path, testFile);
+ expect(result.errors, isEmpty);
+
+ var typeProvider = result.unit.element.context.typeProvider;
+ NodeList<Statement> statements = _getMainStatements(result);
+
+ // var v = 42;
+ VariableElement vElement;
+ {
+ VariableDeclarationStatement statement = statements[0];
+ vElement = statement.variables.variables[0].name.staticElement;
+ }
+
+ // v is! num;
+ {
+ ExpressionStatement statement = statements[1];
+ IsExpression isExpression = statement.expression;
+ expect(isExpression.notOperator, isNotNull);
expect(isExpression.staticType, typeProvider.boolType);
SimpleIdentifier target = isExpression.expression;
@@ -1091,7 +1532,7 @@
test_local_function_namedParameters() async {
addTestFile(r'''
void main() {
- double f(int a, {String b, bool c}) {}
+ double f(int a, {String b, bool c: false}) {}
f(1, b: '2', c: true);
}
''');
@@ -1408,11 +1849,189 @@
{
ExpressionStatement statement = statements[1];
SimpleIdentifier identifier = statement.expression;
- expect(identifier.staticElement, vElement);
+ expect(identifier.staticElement, same(vElement));
expect(identifier.staticType, intType);
}
}
+ test_local_variable_forIn_identifier_field() async {
+ addTestFile(r'''
+class C {
+ num v;
+ void foo() {
+ for (v in <int>[]) {
+ v;
+ }
+ }
+}
+''');
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ ClassDeclaration cDeclaration = unit.declarations[0];
+
+ FieldDeclaration vDeclaration = cDeclaration.members[0];
+ VariableDeclaration vNode = vDeclaration.fields.variables[0];
+ FieldElement vElement = vNode.element;
+ expect(vElement.type, typeProvider.numType);
+
+ MethodDeclaration fooDeclaration = cDeclaration.members[1];
+ BlockFunctionBody fooBody = fooDeclaration.body;
+ List<Statement> statements = fooBody.block.statements;
+
+ ForEachStatement forEachStatement = statements[0];
+ Block forBlock = forEachStatement.body;
+
+ expect(forEachStatement.loopVariable, isNull);
+
+ SimpleIdentifier vInFor = forEachStatement.identifier;
+ expect(vInFor.staticElement, same(vElement.setter));
+ expect(vInFor.staticType, typeProvider.numType);
+
+ ExpressionStatement statement = forBlock.statements[0];
+ SimpleIdentifier identifier = statement.expression;
+ expect(identifier.staticElement, same(vElement.getter));
+ expect(identifier.staticType, typeProvider.numType);
+ }
+
+ test_local_variable_forIn_identifier_localVariable() async {
+ addTestFile(r'''
+void main() {
+ num v;
+ for (v in <int>[]) {
+ v;
+ }
+}
+''');
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ List<Statement> statements = _getMainStatements(result);
+
+ VariableDeclarationStatement vStatement = statements[0];
+ VariableDeclaration vNode = vStatement.variables.variables[0];
+ LocalVariableElement vElement = vNode.element;
+ expect(vElement.type, typeProvider.numType);
+
+ ForEachStatement forEachStatement = statements[1];
+ Block forBlock = forEachStatement.body;
+
+ expect(forEachStatement.loopVariable, isNull);
+
+ SimpleIdentifier vInFor = forEachStatement.identifier;
+ expect(vInFor.staticElement, vElement);
+ expect(vInFor.staticType, typeProvider.numType);
+
+ ExpressionStatement statement = forBlock.statements[0];
+ SimpleIdentifier identifier = statement.expression;
+ expect(identifier.staticElement, same(vElement));
+ expect(identifier.staticType, typeProvider.numType);
+ }
+
+ test_local_variable_forIn_identifier_topLevelVariable() async {
+ addTestFile(r'''
+void main() {
+ for (v in <int>[]) {
+ v;
+ }
+}
+num v;
+''');
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ List<Statement> statements = _getMainStatements(result);
+
+ TopLevelVariableDeclaration vDeclaration = unit.declarations[1];
+ VariableDeclaration vNode = vDeclaration.variables.variables[0];
+ TopLevelVariableElement vElement = vNode.element;
+ expect(vElement.type, typeProvider.numType);
+
+ ForEachStatement forEachStatement = statements[0];
+ Block forBlock = forEachStatement.body;
+
+ expect(forEachStatement.loopVariable, isNull);
+
+ SimpleIdentifier vInFor = forEachStatement.identifier;
+ expect(vInFor.staticElement, same(vElement.setter));
+ expect(vInFor.staticType, typeProvider.numType);
+
+ ExpressionStatement statement = forBlock.statements[0];
+ SimpleIdentifier identifier = statement.expression;
+ expect(identifier.staticElement, same(vElement.getter));
+ expect(identifier.staticType, typeProvider.numType);
+ }
+
+ test_local_variable_forIn_loopVariable() async {
+ addTestFile(r'''
+void main() {
+ for (var v in <int>[]) {
+ v;
+ }
+}
+''');
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ List<Statement> statements = _getMainStatements(result);
+
+ ForEachStatement forEachStatement = statements[0];
+ Block forBlock = forEachStatement.body;
+
+ DeclaredIdentifier vNode = forEachStatement.loopVariable;
+ LocalVariableElement vElement = vNode.element;
+ expect(vElement.type, typeProvider.intType);
+
+ expect(vNode.identifier.staticElement, vElement);
+ expect(vNode.identifier.staticType, typeProvider.intType);
+
+ ExpressionStatement statement = forBlock.statements[0];
+ SimpleIdentifier identifier = statement.expression;
+ expect(identifier.staticElement, vElement);
+ expect(identifier.staticType, typeProvider.intType);
+ }
+
+ test_local_variable_forIn_loopVariable_explicitType() async {
+ addTestFile(r'''
+void main() {
+ for (num v in <int>[]) {
+ v;
+ }
+}
+''');
+ AnalysisResult result = await driver.getResult(testFile);
+ CompilationUnit unit = result.unit;
+ var typeProvider = unit.element.context.typeProvider;
+
+ List<Statement> statements = _getMainStatements(result);
+
+ ForEachStatement forEachStatement = statements[0];
+ Block forBlock = forEachStatement.body;
+
+ DeclaredIdentifier vNode = forEachStatement.loopVariable;
+ LocalVariableElement vElement = vNode.element;
+ expect(vElement.type, typeProvider.numType);
+
+ TypeName vTypeName = vNode.type;
+ expect(vTypeName.type, typeProvider.numType);
+
+ SimpleIdentifier vTypeIdentifier = vTypeName.name;
+ expect(vTypeIdentifier.staticElement, typeProvider.numType.element);
+ expect(vTypeIdentifier.staticType, typeProvider.numType);
+
+ expect(vNode.identifier.staticElement, vElement);
+ expect(vNode.identifier.staticType, typeProvider.numType);
+
+ ExpressionStatement statement = forBlock.statements[0];
+ SimpleIdentifier identifier = statement.expression;
+ expect(identifier.staticElement, vElement);
+ expect(identifier.staticType, typeProvider.numType);
+ }
+
test_local_variable_ofLocalFunction() async {
addTestFile(r'''
void main() {
@@ -1478,7 +2097,120 @@
}
}
- test_methodInvocation_instanceMethod_generic() async {
+ test_method_namedParameters() async {
+ addTestFile(r'''
+class C {
+ double f(int a, {String b, bool c: false}) {}
+}
+void g(C c) {
+ c.f(1, b: '2', c: true);
+}
+''');
+ String fTypeString = '(int, {b: String, c: bool}) → double';
+
+ AnalysisResult result = await driver.getResult(testFile);
+ ClassDeclaration classDeclaration = result.unit.declarations[0];
+ MethodDeclaration methodDeclaration = classDeclaration.members[0];
+ MethodElement methodElement = methodDeclaration.element;
+
+ var typeProvider = result.unit.element.context.typeProvider;
+ InterfaceType doubleType = typeProvider.doubleType;
+
+ expect(methodElement, isNotNull);
+ expect(methodElement.type.toString(), fTypeString);
+
+ expect(methodDeclaration.name.staticElement, same(methodElement));
+ expect(methodDeclaration.name.staticType, methodElement.type);
+
+ TypeName fReturnTypeNode = methodDeclaration.returnType;
+ expect(fReturnTypeNode.name.staticElement, same(doubleType.element));
+ expect(fReturnTypeNode.type, doubleType);
+ //
+ // Validate the parameters at the declaration site.
+ //
+ List<ParameterElement> elements = methodElement.parameters;
+ expect(elements, hasLength(3));
+
+ List<FormalParameter> nodes = methodDeclaration.parameters.parameters;
+ expect(nodes, hasLength(3));
+
+ _assertSimpleParameter(nodes[0], elements[0],
+ name: 'a',
+ offset: 25,
+ kind: ParameterKind.REQUIRED,
+ type: typeProvider.intType);
+
+ _assertDefaultParameter(nodes[1], elements[1],
+ name: 'b',
+ offset: 36,
+ kind: ParameterKind.NAMED,
+ type: typeProvider.stringType);
+
+ _assertDefaultParameter(nodes[2], elements[2],
+ name: 'c',
+ offset: 44,
+ kind: ParameterKind.NAMED,
+ type: typeProvider.boolType);
+ //
+ // Validate the arguments at the call site.
+ //
+ FunctionDeclaration functionDeclaration = result.unit.declarations[1];
+ BlockFunctionBody body = functionDeclaration.functionExpression.body;
+ ExpressionStatement statement = body.block.statements[0];
+ MethodInvocation invocation = statement.expression;
+ List<Expression> arguments = invocation.argumentList.arguments;
+
+ Expression aArgument = arguments[0];
+ ParameterElement aElement = methodElement.parameters[0];
+ expect(aArgument.staticParameterElement, same(aElement));
+
+ NamedExpression bArgument = arguments[1];
+ ParameterElement bElement = methodElement.parameters[1];
+ expect(bArgument.name.label.staticElement, same(bElement));
+ expect(bArgument.staticParameterElement, same(bElement));
+
+ NamedExpression cArgument = arguments[2];
+ ParameterElement cElement = methodElement.parameters[2];
+ expect(cArgument.name.label.staticElement, same(cElement));
+ expect(cArgument.staticParameterElement, same(cElement));
+ }
+
+ test_methodInvocation_instanceMethod_genericClass() async {
+ addTestFile(r'''
+main() {
+ new C<int, double>().m(1);
+}
+class C<T, U> {
+ void m(T p) {}
+}
+''');
+ AnalysisResult result = await driver.getResult(testFile);
+ List<Statement> mainStatements = _getMainStatements(result);
+
+ ClassDeclaration cNode = result.unit.declarations[1];
+ MethodDeclaration mNode = cNode.members[0];
+ MethodElement mElement = mNode.element;
+
+ {
+ ExpressionStatement statement = mainStatements[0];
+ MethodInvocation invocation = statement.expression;
+ List<Expression> arguments = invocation.argumentList.arguments;
+
+ var invokeTypeStr = '(int) → void';
+ expect(invocation.staticType.toString(), 'void');
+ expect(invocation.staticInvokeType.toString(), invokeTypeStr);
+ if (previewDart2) {
+ expect(invocation.staticInvokeType.element, same(mElement));
+ expect(invocation.methodName.staticElement, same(mElement));
+ expect(invocation.methodName.staticType.toString(), invokeTypeStr);
+ }
+
+ Expression argument = arguments[0];
+ expect(argument.staticParameterElement, mElement.parameters[0]);
+ }
+ }
+
+ test_methodInvocation_instanceMethod_genericClass_genericMethod() async {
addTestFile(r'''
main() {
new C<int>().m(1, 2.3);
@@ -1763,6 +2495,74 @@
}
}
+ test_prefixedIdentifier_classInstance_instanceField() async {
+ String content = r'''
+main() {
+ var c = new C();
+ c.f;
+}
+class C {
+ int f;
+}
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ var typeProvider = result.unit.element.context.typeProvider;
+
+ List<Statement> statements = _getMainStatements(result);
+
+ ClassDeclaration cDeclaration = result.unit.declarations[1];
+ ClassElement cElement = cDeclaration.element;
+ FieldElement fElement = cElement.fields[0];
+
+ VariableDeclarationStatement cStatement = statements[0];
+ VariableElement vElement = cStatement.variables.variables[0].element;
+
+ ExpressionStatement statement = statements[1];
+ PrefixedIdentifier prefixed = statement.expression;
+
+ SimpleIdentifier prefix = prefixed.prefix;
+ expect(prefix.staticElement, same(vElement));
+ expect(prefix.staticType, cElement.type);
+
+ SimpleIdentifier identifier = prefixed.identifier;
+ expect(identifier.staticElement, same(fElement.getter));
+ expect(identifier.staticType, typeProvider.intType);
+ }
+
+ test_prefixedIdentifier_className_staticField() async {
+ String content = r'''
+main() {
+ C.f;
+}
+class C {
+ static f = 0;
+}
+''';
+ addTestFile(content);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ var typeProvider = result.unit.element.context.typeProvider;
+
+ List<Statement> statements = _getMainStatements(result);
+
+ ClassDeclaration cDeclaration = result.unit.declarations[1];
+ ClassElement cElement = cDeclaration.element;
+ FieldElement fElement = cElement.fields[0];
+
+ ExpressionStatement statement = statements[0];
+ PrefixedIdentifier prefixed = statement.expression;
+
+ SimpleIdentifier prefix = prefixed.prefix;
+ expect(prefix.staticElement, same(cElement));
+ expect(prefix.staticType, cElement.type);
+
+ SimpleIdentifier identifier = prefixed.identifier;
+ expect(identifier.staticElement, same(fElement.getter));
+ expect(identifier.staticType, typeProvider.intType);
+ }
+
test_prefixExpression_local() async {
String content = r'''
main() {
@@ -2558,6 +3358,91 @@
expect(aValue.staticType, typeProvider.intType);
}
+ test_top_function_namedParameters() async {
+ addTestFile(r'''
+double f(int a, {String b, bool c: 1 == 2}) {}
+void main() {
+ f(1, b: '2', c: true);
+}
+''');
+ String fTypeString = '(int, {b: String, c: bool}) → double';
+
+ AnalysisResult result = await driver.getResult(testFile);
+ FunctionDeclaration fDeclaration = result.unit.declarations[0];
+ FunctionElement fElement = fDeclaration.element;
+
+ var typeProvider = result.unit.element.context.typeProvider;
+ InterfaceType doubleType = typeProvider.doubleType;
+
+ expect(fElement, isNotNull);
+ expect(fElement.type.toString(), fTypeString);
+
+ expect(fDeclaration.name.staticElement, same(fElement));
+ expect(fDeclaration.name.staticType, fElement.type);
+
+ TypeName fReturnTypeNode = fDeclaration.returnType;
+ expect(fReturnTypeNode.name.staticElement, same(doubleType.element));
+ expect(fReturnTypeNode.type, doubleType);
+ //
+ // Validate the parameters at the declaration site.
+ //
+ List<ParameterElement> elements = fElement.parameters;
+ expect(elements, hasLength(3));
+
+ List<FormalParameter> nodes =
+ fDeclaration.functionExpression.parameters.parameters;
+ expect(nodes, hasLength(3));
+
+ _assertSimpleParameter(nodes[0], elements[0],
+ name: 'a',
+ offset: 13,
+ kind: ParameterKind.REQUIRED,
+ type: typeProvider.intType);
+
+ DefaultFormalParameter bNode = nodes[1];
+ _assertDefaultParameter(bNode, elements[1],
+ name: 'b',
+ offset: 24,
+ kind: ParameterKind.NAMED,
+ type: typeProvider.stringType);
+ expect(bNode.defaultValue, isNull);
+
+ DefaultFormalParameter cNode = nodes[2];
+ _assertDefaultParameter(cNode, elements[2],
+ name: 'c',
+ offset: 32,
+ kind: ParameterKind.NAMED,
+ type: typeProvider.boolType);
+ {
+ BinaryExpression defaultValue = cNode.defaultValue;
+ expect(defaultValue.staticElement, isNotNull);
+ expect(defaultValue.staticType, typeProvider.boolType);
+ }
+
+ //
+ // Validate the arguments at the call site.
+ //
+ FunctionDeclaration mainDeclaration = result.unit.declarations[1];
+ BlockFunctionBody body = mainDeclaration.functionExpression.body;
+ ExpressionStatement statement = body.block.statements[0];
+ MethodInvocation invocation = statement.expression;
+ List<Expression> arguments = invocation.argumentList.arguments;
+
+ Expression aArgument = arguments[0];
+ ParameterElement aElement = fElement.parameters[0];
+ expect(aArgument.staticParameterElement, same(aElement));
+
+ NamedExpression bArgument = arguments[1];
+ ParameterElement bElement = fElement.parameters[1];
+ expect(bArgument.name.label.staticElement, same(bElement));
+ expect(bArgument.staticParameterElement, same(bElement));
+
+ NamedExpression cArgument = arguments[2];
+ ParameterElement cElement = fElement.parameters[2];
+ expect(cArgument.name.label.staticElement, same(cElement));
+ expect(cArgument.staticParameterElement, same(cElement));
+ }
+
void _assertDefaultParameter(
DefaultFormalParameter node, ParameterElement element,
{String name, int offset, ParameterKind kind, DartType type}) {
diff --git a/pkg/analyzer/test/src/fasta/message_coverage_test.dart b/pkg/analyzer/test/src/fasta/message_coverage_test.dart
index 70ff01a..2911531 100644
--- a/pkg/analyzer/test/src/fasta/message_coverage_test.dart
+++ b/pkg/analyzer/test/src/fasta/message_coverage_test.dart
@@ -180,8 +180,8 @@
buffer.write(' ');
buffer.writeln(code);
}
- buffer.write(
- 'Remove the cases for these codes from FastaErrorReporter.reportError.');
+ buffer.write('Remove the cases for these codes from '
+ 'FastaErrorReporter.reportMessage.');
}
if (buffer.isNotEmpty) {
fail(buffer.toString());
diff --git a/pkg/analyzer/test/src/fasta/resolution_applier_test.dart b/pkg/analyzer/test/src/fasta/resolution_applier_test.dart
index 47da543..3b84c9e 100644
--- a/pkg/analyzer/test/src/fasta/resolution_applier_test.dart
+++ b/pkg/analyzer/test/src/fasta/resolution_applier_test.dart
@@ -35,8 +35,14 @@
/// [referencedElements], and [types] to the body of the function.
/// 3. Verify that everything in the function body that should be resolved
/// _is_ resolved.
- void applyTypes(String content, List<Element> declaredElements,
- List<Element> referencedElements, List<DartType> types) {
+ void applyTypes(
+ String content,
+ List<Element> declaredElements,
+ List<int> declareElementOffsets,
+ List<Element> referencedElements,
+ List<int> referencedElementOffsets,
+ List<DartType> types,
+ List<int> typeOffsets) {
CompilationUnit unit = parseCompilationUnit(content);
expect(unit, isNotNull);
expect(unit.declarations, hasLength(1));
@@ -45,8 +51,11 @@
ResolutionApplier applier = new ResolutionApplier(
new _TestTypeContext(),
declaredElements,
+ declareElementOffsets,
referencedElements,
- types.map((type) => new _KernelWrapperOfType(type)).toList());
+ referencedElementOffsets,
+ types.map((type) => new _KernelWrapperOfType(type)).toList(),
+ typeOffsets);
body.accept(applier);
applier.checkDone();
@@ -67,15 +76,24 @@
f(String s, int i) {
return s + i;
}
-''', [], [
+''', [], [], [
_createFunctionParameter('s', 9),
new MethodElementImpl('+', -1),
_createFunctionParameter('i', 16),
+ ], [
+ 30,
+ 32,
+ 34
], <DartType>[
typeProvider.stringType,
new FunctionTypeImpl(new FunctionElementImpl('+', -1)),
typeProvider.intType,
typeProvider.stringType,
+ ], [
+ 30,
+ 32,
+ 32,
+ 34
]);
}
@@ -84,16 +102,26 @@
f(Object a) {
return a.b().c();
}
-''', [], [
+''', [], [], [
_createFunctionParameter('a', 9),
new MethodElementImpl('b', -1),
new MethodElementImpl('c', -1)
+ ], [
+ 23,
+ 25,
+ 29
], <DartType>[
typeProvider.objectType,
typeProvider.objectType,
typeProvider.objectType,
typeProvider.objectType,
typeProvider.objectType
+ ], [
+ 23,
+ 25,
+ 26,
+ 29,
+ 30
]);
}
@@ -113,50 +141,71 @@
f() {
int Function(String, bool x) foo;
}
-''', [new LocalVariableElementImpl('foo', 37)], [], <DartType>[functionType]);
+''', [new LocalVariableElementImpl('foo', 37)], [37], [], [],
+ <DartType>[functionType], [37]);
}
void test_listLiteral_const_noAnnotation() {
applyTypes(r'''
get f => const ['a', 'b', 'c'];
-''', [], [], <DartType>[
+''', [], [], [], [], <DartType>[
typeProvider.stringType,
typeProvider.stringType,
typeProvider.stringType,
typeProvider.listType.instantiate([typeProvider.stringType])
+ ], [
+ 16,
+ 21,
+ 26,
+ 9
]);
}
void test_listLiteral_const_typeAnnotation() {
applyTypes(r'''
get f => const <String>['a', 'b', 'c'];
-''', [], [], <DartType>[
+''', [], [], [], [], <DartType>[
typeProvider.stringType,
typeProvider.stringType,
typeProvider.stringType,
typeProvider.listType.instantiate([typeProvider.stringType])
+ ], [
+ 24,
+ 29,
+ 34,
+ 9
]);
}
void test_listLiteral_noAnnotation() {
applyTypes(r'''
get f => ['a', 'b', 'c'];
-''', [], [], <DartType>[
+''', [], [], [], [], <DartType>[
typeProvider.stringType,
typeProvider.stringType,
typeProvider.stringType,
typeProvider.listType.instantiate([typeProvider.stringType])
+ ], [
+ 10,
+ 15,
+ 20,
+ 9
]);
}
void test_listLiteral_typeAnnotation() {
applyTypes(r'''
get f => <String>['a', 'b', 'c'];
-''', [], [], <DartType>[
+''', [], [], [], [], <DartType>[
typeProvider.stringType,
typeProvider.stringType,
typeProvider.stringType,
typeProvider.listType.instantiate([typeProvider.stringType])
+ ], [
+ 18,
+ 23,
+ 28,
+ 17
]);
}
@@ -169,13 +218,14 @@
f() {
Map<String, List<String>> m = {};
}
-''', [new LocalVariableElementImpl('m', 34)], [], <DartType>[mapType, mapType]);
+''', [new LocalVariableElementImpl('m', 34)], [34], [], [],
+ <DartType>[mapType, mapType], [34, 38]);
}
void test_mapLiteral_const_noAnnotation() {
applyTypes(r'''
get f => const {'a' : 1, 'b' : 2, 'c' : 3};
-''', [], [], <DartType>[
+''', [], [], [], [], <DartType>[
typeProvider.stringType,
typeProvider.intType,
typeProvider.stringType,
@@ -184,13 +234,21 @@
typeProvider.intType,
typeProvider.mapType
.instantiate([typeProvider.stringType, typeProvider.intType])
+ ], [
+ 16,
+ 22,
+ 25,
+ 31,
+ 34,
+ 40,
+ 9
]);
}
void test_mapLiteral_const_typeAnnotation() {
applyTypes(r'''
get f => const <String, int>{'a' : 1, 'b' : 2, 'c' : 3};
-''', [], [], <DartType>[
+''', [], [], [], [], <DartType>[
typeProvider.stringType,
typeProvider.intType,
typeProvider.stringType,
@@ -199,13 +257,21 @@
typeProvider.intType,
typeProvider.mapType
.instantiate([typeProvider.stringType, typeProvider.intType])
+ ], [
+ 29,
+ 35,
+ 38,
+ 44,
+ 47,
+ 53,
+ 9
]);
}
void test_mapLiteral_noAnnotation() {
applyTypes(r'''
get f => {'a' : 1, 'b' : 2, 'c' : 3};
-''', [], [], <DartType>[
+''', [], [], [], [], <DartType>[
typeProvider.stringType,
typeProvider.intType,
typeProvider.stringType,
@@ -214,13 +280,21 @@
typeProvider.intType,
typeProvider.mapType
.instantiate([typeProvider.stringType, typeProvider.intType])
+ ], [
+ 10,
+ 16,
+ 19,
+ 25,
+ 28,
+ 34,
+ 9
]);
}
void test_mapLiteral_typeAnnotation() {
applyTypes(r'''
get f => <String, int>{'a' : 1, 'b' : 2, 'c' : 3};
-''', [], [], <DartType>[
+''', [], [], [], [], <DartType>[
typeProvider.stringType,
typeProvider.intType,
typeProvider.stringType,
@@ -229,6 +303,14 @@
typeProvider.intType,
typeProvider.mapType
.instantiate([typeProvider.stringType, typeProvider.intType])
+ ], [
+ 23,
+ 29,
+ 32,
+ 38,
+ 41,
+ 47,
+ 9
]);
}
@@ -237,12 +319,18 @@
f(String s) {
return s.length;
}
-''', [], [
+''', [], [], [
_createFunctionParameter('s', 9),
new MethodElementImpl('length', -1)
+ ], [
+ 23,
+ 25
], <DartType>[
typeProvider.stringType,
typeProvider.intType,
+ ], [
+ 23,
+ 25
]);
}
@@ -251,15 +339,24 @@
f(String s) {
return s.substring(3, 7);
}
-''', [], [
+''', [], [], [
_createFunctionParameter('s', 9),
new MethodElementImpl('length', -1)
+ ], [
+ 23,
+ 25
], <DartType>[
typeProvider.stringType,
typeProvider.intType,
typeProvider.intType,
typeProvider.stringType,
typeProvider.stringType
+ ], [
+ 23,
+ 25,
+ 34,
+ 35,
+ 38
]);
}
@@ -283,7 +380,8 @@
A<int, String> foo;
}
//typedef B A<B, C>(C x);
-''', [new LocalVariableElementImpl('foo', 23)], [], <DartType>[functionType]);
+''', [new LocalVariableElementImpl('foo', 23)], [], [], [],
+ <DartType>[functionType], []);
}
/// Return a newly created parameter element with the given [name] and
@@ -323,6 +421,9 @@
ClassElement get enclosingClassElement => null;
@override
+ DartType get stringType => null;
+
+ @override
DartType get typeType => null;
@override
diff --git a/pkg/compiler/lib/compiler_new.dart b/pkg/compiler/lib/compiler_new.dart
index 47d39cd..23dda02 100644
--- a/pkg/compiler/lib/compiler_new.dart
+++ b/pkg/compiler/lib/compiler_new.dart
@@ -9,8 +9,11 @@
import 'dart:async';
+import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
+
import 'compiler.dart' show Diagnostic;
import 'src/apiimpl.dart';
+import 'src/library_loader.dart';
import 'src/options.dart' show CompilerOptions;
export 'compiler.dart' show Diagnostic, PackagesDiscoveryProvider;
@@ -134,7 +137,10 @@
/// Use only for debugging and testing.
final compiler;
- CompilationResult(this.compiler, {this.isSuccess: true});
+ final fe.InitializedCompilerState kernelInitializedCompilerState;
+
+ CompilationResult(this.compiler,
+ {this.isSuccess: true, this.kernelInitializedCompilerState: null});
}
/// Returns a future that completes to a [CompilationResult] when the Dart
@@ -167,6 +173,12 @@
CompilerImpl compiler = new CompilerImpl(
compilerInput, compilerOutput, compilerDiagnostics, compilerOptions);
return compiler.run(compilerOptions.entryPoint).then((bool success) {
+ if (compiler.libraryLoader is KernelLibraryLoaderTask) {
+ KernelLibraryLoaderTask loader = compiler.libraryLoader;
+ return new CompilationResult(compiler,
+ isSuccess: success,
+ kernelInitializedCompilerState: loader.initializedCompilerState);
+ }
return new CompilationResult(compiler, isSuccess: success);
});
}
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index a6f981e..a88db74 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -191,7 +191,8 @@
_reporter = new CompilerDiagnosticReporter(this, options);
}
frontendStrategy = options.useKernel
- ? new KernelFrontEndStrategy(options, reporter, environment)
+ ? new KernelFrontEndStrategy(options, reporter, environment,
+ options.kernelInitializedCompilerState)
: new ResolutionFrontEndStrategy(this);
backendStrategy = options.useKernel
? new KernelBackendStrategy(this)
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 2c5ca33..9d89aca 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -8,9 +8,9 @@
import 'dart:convert' show UTF8, LineSplitter;
import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr;
+import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
import 'package:front_end/src/compute_platform_binaries_location.dart'
show computePlatformBinariesLocation;
-
import 'package:package_config/discovery.dart' show findPackages;
import '../compiler_new.dart' as api;
@@ -110,7 +110,8 @@
FormattingDiagnosticHandler diagnosticHandler;
-Future<api.CompilationResult> compile(List<String> argv) {
+Future<api.CompilationResult> compile(List<String> argv,
+ {fe.InitializedCompilerState kernelInitializedCompilerState}) {
Stopwatch wallclock = new Stopwatch()..start();
stackTraceFilePrefix = '$currentDirectory';
Uri libraryRoot = currentDirectory;
@@ -603,7 +604,8 @@
resolutionInputs: resolutionInputs,
resolutionOutput: resolveOnly ? resolutionOutput : null,
options: options,
- environment: environment);
+ environment: environment)
+ ..kernelInitializedCompilerState = kernelInitializedCompilerState;
return compileFunc(
compilerOptions, inputProvider, diagnosticHandler, outputProvider)
.then(compilationDone);
@@ -656,11 +658,13 @@
exitFunc(1);
}
-Future<api.CompilationResult> compilerMain(List<String> arguments) {
+Future<api.CompilationResult> compilerMain(List<String> arguments,
+ {fe.InitializedCompilerState kernelInitializedCompilerState}) {
var root = uriPathToNative("/$LIBRARY_ROOT");
arguments = <String>['--library-root=${Platform.script.toFilePath()}$root']
..addAll(arguments);
- return compile(arguments);
+ return compile(arguments,
+ kernelInitializedCompilerState: kernelInitializedCompilerState);
}
void help() {
@@ -868,7 +872,8 @@
/// Set this to `false` in end-to-end tests to avoid generating '.deps' files.
bool enableWriteString = true;
-Future<api.CompilationResult> internalMain(List<String> arguments) {
+Future<api.CompilationResult> internalMain(List<String> arguments,
+ {fe.InitializedCompilerState kernelInitializedCompilerState}) {
Future onError(exception, trace) {
// If we are already trying to exit, just continue exiting.
if (exception == _EXIT_SIGNAL) throw exception;
@@ -890,7 +895,9 @@
}
try {
- return compilerMain(arguments).catchError(onError);
+ return compilerMain(arguments,
+ kernelInitializedCompilerState: kernelInitializedCompilerState)
+ .catchError(onError);
} catch (exception, trace) {
return onError(exception, trace);
}
@@ -919,6 +926,7 @@
var stream = stdin.transform(UTF8.decoder).transform(new LineSplitter());
var subscription;
+ fe.InitializedCompilerState kernelInitializedCompilerState;
subscription = stream.listen((line) {
new Future.sync(() {
subscription.pause();
@@ -927,11 +935,16 @@
List<String> args = <String>[];
args.addAll(batchArguments);
args.addAll(splitLine(line, windows: Platform.isWindows));
- return internalMain(args);
+ return internalMain(args,
+ kernelInitializedCompilerState: kernelInitializedCompilerState);
}).catchError((exception, trace) {
if (!identical(exception, _EXIT_SIGNAL)) {
exitCode = 253;
}
+ }).then((api.CompilationResult result) {
+ if (result != null) {
+ kernelInitializedCompilerState = result.kernelInitializedCompilerState;
+ }
}).whenComplete(() {
// The testing framework waits for a status line on stdout and
// stderr before moving to the next test.
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index 6c1d26c..97252ba5c 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -2480,10 +2480,7 @@
MessageKind.UNSUPPORTED_PREFIX_PLUS: const MessageTemplate(
MessageKind.UNSUPPORTED_PREFIX_PLUS, "'+' is not a prefix operator. ",
- howToFix: "Try removing '+'.",
- examples: const [
- "main() => +2; // No longer a valid way to write '2'"
- ]),
+ howToFix: "Try removing '+'."),
MessageKind.MIRRORS_EXPECTED_STRING: const MessageTemplate(
MessageKind.MIRRORS_EXPECTED_STRING,
diff --git a/pkg/compiler/lib/src/elements/types.dart b/pkg/compiler/lib/src/elements/types.dart
index 26dfbc8..5deca06 100644
--- a/pkg/compiler/lib/src/elements/types.dart
+++ b/pkg/compiler/lib/src/elements/types.dart
@@ -241,6 +241,20 @@
}
}
+/// Provides a thin model of method type variables for compabitility with the
+/// old compiler behavior in Dart 1: They are treated as if their value were
+/// `dynamic` when used in a type annotation, and as a malformed type when
+/// used in an `as` or `is` expression.
+class Dart1MethodTypeVariableType extends TypeVariableType {
+ Dart1MethodTypeVariableType(TypeVariableEntity element) : super(element);
+
+ @override
+ bool get treatAsDynamic => true;
+
+ @override
+ bool get isMalformed => true;
+}
+
class TypeVariableType extends DartType {
final TypeVariableEntity element;
diff --git a/pkg/compiler/lib/src/io/kernel_source_information.dart b/pkg/compiler/lib/src/io/kernel_source_information.dart
index ac8d64d..421ed12 100644
--- a/pkg/compiler/lib/src/io/kernel_source_information.dart
+++ b/pkg/compiler/lib/src/io/kernel_source_information.dart
@@ -399,6 +399,11 @@
}
return _buildTreeNode(definition.node);
}
+
+ @override
+ SourceInformation buildGoto(ir.Node node) {
+ return _buildTreeNode(node);
+ }
}
class KernelSourceLocation extends AbstractSourceLocation {
diff --git a/pkg/compiler/lib/src/io/multi_information.dart b/pkg/compiler/lib/src/io/multi_information.dart
index 821fd71..9f8d909 100644
--- a/pkg/compiler/lib/src/io/multi_information.dart
+++ b/pkg/compiler/lib/src/io/multi_information.dart
@@ -287,6 +287,12 @@
return new MultiSourceInformation(
builders.map((b) => b.buildDeclaration(member)).toList());
}
+
+ @override
+ SourceInformation buildGoto(T node) {
+ return new MultiSourceInformation(
+ builders.map((b) => b.buildGoto(node)).toList());
+ }
}
class MultiSourceInformation implements SourceInformation {
diff --git a/pkg/compiler/lib/src/io/position_information.dart b/pkg/compiler/lib/src/io/position_information.dart
index 9630474..4363274 100644
--- a/pkg/compiler/lib/src/io/position_information.dart
+++ b/pkg/compiler/lib/src/io/position_information.dart
@@ -350,6 +350,9 @@
@override
SourceInformation buildSwitchCase(Node node) => buildBegin(node);
+
+ @override
+ SourceInformation buildGoto(Node node) => buildBegin(node);
}
/// The start, end and closing offsets for a [js.Node].
diff --git a/pkg/compiler/lib/src/io/source_information.dart b/pkg/compiler/lib/src/io/source_information.dart
index 011c6b1..ac33b01 100644
--- a/pkg/compiler/lib/src/io/source_information.dart
+++ b/pkg/compiler/lib/src/io/source_information.dart
@@ -172,6 +172,9 @@
/// Generate [SourceInformation] for the list literal in [node].
SourceInformation buildListLiteral(T node) => null;
+
+ /// Generate [SourceInformation] for the break/continue in [node].
+ SourceInformation buildGoto(T node) => null;
}
/// A location in a source file.
diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart
index 5d2530f..9088db4 100644
--- a/pkg/compiler/lib/src/kernel/element_map_impl.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart
@@ -1533,6 +1533,15 @@
// [FunctionTypeParameter] type.
return const DynamicType();
}
+ if (node.parameter.parent is ir.FunctionNode &&
+ node.parameter.parent.parent is ir.Procedure) {
+ // Special case for Dart 1 compatibility in checked mode.
+ ir.Procedure typeParameterParent = node.parameter.parent.parent;
+ if (typeParameterParent.kind != ir.ProcedureKind.Factory) {
+ return new Dart1MethodTypeVariableType(
+ elementMap.getTypeVariable(node.parameter));
+ }
+ }
return new TypeVariableType(elementMap.getTypeVariable(node.parameter));
}
diff --git a/pkg/compiler/lib/src/kernel/kernel_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_strategy.dart
index e4e03e3..e18148c 100644
--- a/pkg/compiler/lib/src/kernel/kernel_strategy.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_strategy.dart
@@ -4,6 +4,8 @@
library dart2js.kernel.frontend_strategy;
+import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
+
import '../../compiler_new.dart' as api;
import '../common.dart';
import '../common/backend_api.dart';
@@ -54,8 +56,10 @@
final Map<MemberEntity, ScopeModel> closureModels =
<MemberEntity, ScopeModel>{};
- KernelFrontEndStrategy(
- this._options, DiagnosticReporter reporter, env.Environment environment) {
+ fe.InitializedCompilerState initializedCompilerState;
+
+ KernelFrontEndStrategy(this._options, DiagnosticReporter reporter,
+ env.Environment environment, this.initializedCompilerState) {
_elementMap = new KernelToElementMapForImpactImpl(
reporter, environment, this, _options);
}
@@ -74,7 +78,8 @@
Measurer measurer) {
return new KernelLibraryLoaderTask(_options.platformBinaries,
_options.packageConfig, _elementMap, compilerInput, reporter, measurer,
- verbose: _options.verbose);
+ verbose: _options.verbose,
+ initializedCompilerState: initializedCompilerState);
}
@override
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index 59a50e4..b4d108f 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -6,7 +6,7 @@
import 'dart:async';
-import 'package:front_end/src/api_prototype/front_end.dart' as fe;
+import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
import 'package:kernel/ast.dart' as ir;
import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder;
import 'package:kernel/kernel.dart' hide LibraryDependency, Combinator;
@@ -838,9 +838,11 @@
List<LibraryEntity> _allLoadedLibraries;
+ fe.InitializedCompilerState initializedCompilerState;
+
KernelLibraryLoaderTask(this.platformBinaries, this._packageConfig,
this._elementMap, this.compilerInput, this.reporter, Measurer measurer,
- {this.verbose: false})
+ {this.verbose: false, this.initializedCompilerState})
: _allLoadedLibraries = new List<LibraryEntity>(),
super(measurer);
@@ -859,17 +861,17 @@
program = new ir.Program();
new BinaryBuilder(input.data).readProgram(program);
} else {
- var options = new fe.CompilerOptions()
- ..verbose = verbose
- ..fileSystem = new CompilerFileSystem(compilerInput)
- ..target = new Dart2jsTarget(new TargetFlags())
- ..linkedDependencies = [
+ initializedCompilerState = fe.initializeCompiler(
+ initializedCompilerState,
+ new Dart2jsTarget(new TargetFlags()),
platformBinaries.resolve("dart2js_platform.dill"),
- ]
- ..packagesFileUri = _packageConfig
- ..onError = (e) => reportFrontEndMessage(reporter, e);
-
- program = await fe.kernelForProgram(resolvedUri, options);
+ _packageConfig);
+ program = await fe.compile(
+ initializedCompilerState,
+ verbose,
+ new CompilerFileSystem(compilerInput),
+ (e) => reportFrontEndMessage(reporter, e),
+ resolvedUri);
}
if (program == null) return null;
return createLoadedLibraries(program);
diff --git a/pkg/compiler/lib/src/options.dart b/pkg/compiler/lib/src/options.dart
index 3737dac..466e63a 100644
--- a/pkg/compiler/lib/src/options.dart
+++ b/pkg/compiler/lib/src/options.dart
@@ -4,6 +4,8 @@
library dart2js.src.options;
+import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
+
import '../compiler.dart' show PackagesDiscoveryProvider;
import 'commandline_options.dart' show Flags;
@@ -61,6 +63,9 @@
/// flags.
final Map<String, dynamic> environment;
+ /// A possibly null state object for kernel compilation.
+ fe.InitializedCompilerState kernelInitializedCompilerState;
+
/// Whether we allow mocking compilation of libraries such as dart:io and
/// dart:html for unit testing purposes.
final bool allowMockCompilation;
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 69fc945..4ac1aa3 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -1416,8 +1416,12 @@
tryInlineMethod(body, null, null, bodyCallInputs, function)) {
pop();
} else {
+ ConstructorBodyElement declaration = body.declaration;
HInvokeConstructorBody invoke = new HInvokeConstructorBody(
- body.declaration, bodyCallInputs, commonMasks.nonNullType);
+ declaration,
+ bodyCallInputs,
+ commonMasks.nonNullType,
+ sourceInformationBuilder.buildDeclaration(constructor));
invoke.sideEffects = closedWorld.getSideEffectsOfElement(constructor);
add(invoke);
}
@@ -1485,7 +1489,7 @@
// because that is where the type guards will also be inserted.
// This way we ensure that a type guard will dominate the type
// check.
- signature.orderedForEachParameter((_parameterElement) {
+ signature.forEachParameter((_parameterElement) {
ParameterElement parameterElement = _parameterElement;
if (element.isGenerativeConstructorBody) {
if (closureDataLookup
@@ -1888,7 +1892,7 @@
loopEntryBlock.setBlockFlow(info, current);
jumpHandler.forEachBreak((HBreak breakInstruction, _) {
HBasicBlock block = breakInstruction.block;
- block.addAtExit(new HBreak.toLabel(label));
+ block.addAtExit(new HBreak.toLabel(label, sourceInformation));
block.remove(breakInstruction);
});
}
@@ -5440,10 +5444,10 @@
JumpHandler handler = jumpTargets[target];
assert(handler != null);
if (node.target == null) {
- handler.generateBreak();
+ handler.generateBreak(sourceInformationBuilder.buildGoto(node));
} else {
LabelDefinition label = elements.getTargetLabel(node);
- handler.generateBreak(label);
+ handler.generateBreak(sourceInformationBuilder.buildGoto(node), label);
}
}
@@ -5454,11 +5458,11 @@
JumpHandler handler = jumpTargets[target];
assert(handler != null);
if (node.target == null) {
- handler.generateContinue();
+ handler.generateContinue(sourceInformationBuilder.buildGoto(node));
} else {
LabelDefinition label = elements.getTargetLabel(node);
assert(label != null);
- handler.generateContinue(label);
+ handler.generateContinue(sourceInformationBuilder.buildGoto(node), label);
}
}
@@ -6050,17 +6054,21 @@
}
void buildSwitchCase(ast.SwitchCase switchCase) {
+ SourceInformation caseSourceInformation = sourceInformation;
if (switchCase != null) {
+ caseSourceInformation = sourceInformationBuilder.buildGoto(switchCase);
// Generate 'target = i; break;' for switch case i.
int index = caseIndex[switchCase];
HInstruction value = graph.addConstantInt(index, closedWorld);
- localsHandler.updateLocal(switchTarget, value);
+ localsHandler.updateLocal(switchTarget, value,
+ sourceInformation: caseSourceInformation);
} else {
// Generate synthetic default case 'target = null; break;'.
HInstruction value = graph.addConstantNull(closedWorld);
- localsHandler.updateLocal(switchTarget, value);
+ localsHandler.updateLocal(switchTarget, value,
+ sourceInformation: caseSourceInformation);
}
- jumpTargets[switchTarget].generateBreak();
+ jumpTargets[switchTarget].generateBreak(caseSourceInformation);
}
handleSwitch(node, jumpHandler, buildExpression, switchCases, getConstants,
@@ -6083,7 +6091,7 @@
if (!isAborted()) {
// Ensure that we break the loop if the case falls through. (This
// is only possible for the last case.)
- jumpTargets[switchTarget].generateBreak();
+ jumpTargets[switchTarget].generateBreak(sourceInformation);
}
}
@@ -6129,7 +6137,8 @@
node: node,
visitCondition: buildCondition,
visitThen: buildLoop,
- visitElse: () => {});
+ visitElse: () => {},
+ sourceInformation: sourceInformation);
}
}
@@ -6196,7 +6205,7 @@
// If there is no default, we will add one later to avoid
// the critical edge. So we generate a break statement to make
// sure the last case does not fall through to the default case.
- jumpHandler.generateBreak();
+ jumpHandler.generateBreak(sourceInformation);
}
}
statements.add(
@@ -7038,7 +7047,7 @@
if (!checkOrTrustTypes) return;
FunctionSignature signature = function.functionSignature;
- signature.orderedForEachParameter((_parameter) {
+ signature.forEachParameter((_parameter) {
ParameterElement parameter = _parameter;
HInstruction argument = builder.localsHandler.readLocal(parameter);
potentiallyCheckOrTrustType(argument, parameter.type);
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index e3a2cdf..22975c1 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -534,7 +534,11 @@
}
// TODO(redemption): Try to inline [body].
- _invokeConstructorBody(body, bodyCallInputs);
+ _invokeConstructorBody(
+ body,
+ bodyCallInputs,
+ _sourceInformationBuilder
+ .buildDeclaration(_elementMap.getMember(constructor)));
});
}
@@ -553,12 +557,12 @@
return false;
}
- void _invokeConstructorBody(
- ir.Constructor constructor, List<HInstruction> inputs) {
+ void _invokeConstructorBody(ir.Constructor constructor,
+ List<HInstruction> inputs, SourceInformation sourceInformation) {
// TODO(sra): Inline the constructor body.
MemberEntity constructorBody = _elementMap.getConstructorBody(constructor);
HInvokeConstructorBody invoke = new HInvokeConstructorBody(
- constructorBody, inputs, commonMasks.nonNullType);
+ constructorBody, inputs, commonMasks.nonNullType, sourceInformation);
add(invoke);
}
@@ -841,6 +845,7 @@
void buildConstructorBody(ir.Constructor constructor) {
openFunction(constructor.function);
_addClassTypeVariablesIfNeeded(constructor);
+ _potentiallyAddFunctionParameterTypeChecks(constructor.function);
constructor.function.body.accept(this);
closeFunction();
}
@@ -864,20 +869,18 @@
FunctionEntity method = _elementMap.getMethod(parent);
if (!_commonElements.operatorEqHandlesNullArgument(method)) {
handleIf(
- visitCondition: () {
- HParameterValue parameter = parameters.values.first;
- push(new HIdentity(parameter, graph.addConstantNull(closedWorld),
- null, commonMasks.boolType));
- },
- visitThen: () {
- closeAndGotoExit(new HReturn(
- graph.addConstantBool(false, closedWorld),
- _sourceInformationBuilder.buildReturn(functionNode)));
- },
- visitElse: null,
- // TODO(27394): Add sourceInformation via
- // `_sourceInformationBuilder.buildIf(?)`.
- );
+ visitCondition: () {
+ HParameterValue parameter = parameters.values.first;
+ push(new HIdentity(parameter, graph.addConstantNull(closedWorld),
+ null, commonMasks.boolType));
+ },
+ visitThen: () {
+ closeAndGotoExit(new HReturn(
+ graph.addConstantBool(false, closedWorld),
+ _sourceInformationBuilder.buildReturn(functionNode)));
+ },
+ visitElse: null,
+ sourceInformation: _sourceInformationBuilder.buildIf(functionNode));
}
}
functionNode.body.accept(this);
@@ -1391,17 +1394,23 @@
TypeMask mask = _typeInferenceMap.typeOfIterator(node);
node.iterable.accept(this);
HInstruction receiver = pop();
- _pushDynamicInvocation(node, mask, <HInstruction>[receiver],
- _sourceInformationBuilder.buildForInIterator(node),
- selector: Selectors.iterator);
+ _pushDynamicInvocation(
+ node,
+ mask,
+ Selectors.iterator,
+ <HInstruction>[receiver],
+ _sourceInformationBuilder.buildForInIterator(node));
iterator = pop();
}
HInstruction buildCondition() {
TypeMask mask = _typeInferenceMap.typeOfIteratorMoveNext(node);
- _pushDynamicInvocation(node, mask, <HInstruction>[iterator],
- _sourceInformationBuilder.buildForInMoveNext(node),
- selector: Selectors.moveNext);
+ _pushDynamicInvocation(
+ node,
+ mask,
+ Selectors.moveNext,
+ <HInstruction>[iterator],
+ _sourceInformationBuilder.buildForInMoveNext(node));
return popBoolified();
}
@@ -1409,8 +1418,8 @@
SourceInformation sourceInformation =
_sourceInformationBuilder.buildForInCurrent(node);
TypeMask mask = _typeInferenceMap.typeOfIteratorCurrent(node);
- _pushDynamicInvocation(node, mask, [iterator], sourceInformation,
- selector: Selectors.current);
+ _pushDynamicInvocation(
+ node, mask, Selectors.current, [iterator], sourceInformation);
Local loopVariableLocal = localsMap.getLocalVariable(node.variable);
HInstruction value = typeBuilder.potentiallyCheckOrTrustType(
@@ -1451,9 +1460,8 @@
HInstruction buildCondition() {
TypeMask mask = _typeInferenceMap.typeOfIteratorMoveNext(node);
- _pushDynamicInvocation(node, mask, [streamIterator],
- _sourceInformationBuilder.buildForInMoveNext(node),
- selector: Selectors.moveNext);
+ _pushDynamicInvocation(node, mask, Selectors.moveNext, [streamIterator],
+ _sourceInformationBuilder.buildForInMoveNext(node));
HInstruction future = pop();
push(new HAwait(future, closedWorld.commonMasks.dynamicType));
return popBoolified();
@@ -1461,9 +1469,8 @@
void buildBody() {
TypeMask mask = _typeInferenceMap.typeOfIteratorCurrent(node);
- _pushDynamicInvocation(node, mask, [streamIterator],
- _sourceInformationBuilder.buildForInIterator(node),
- selector: Selectors.current);
+ _pushDynamicInvocation(node, mask, Selectors.current, [streamIterator],
+ _sourceInformationBuilder.buildForInIterator(node));
localsHandler.updateLocal(
localsMap.getLocalVariable(node.variable), pop());
node.body.accept(this);
@@ -1486,9 +1493,8 @@
_sourceInformationBuilder.buildLoop(node));
void finalizerFunction() {
- _pushDynamicInvocation(node, null, [streamIterator],
- _sourceInformationBuilder.buildGeneric(node),
- selector: Selectors.cancel);
+ _pushDynamicInvocation(node, null, Selectors.cancel, [streamIterator],
+ _sourceInformationBuilder.buildGeneric(node));
add(new HAwait(pop(), closedWorld.commonMasks.dynamicType));
}
@@ -1674,7 +1680,7 @@
loopEntryBlock.setBlockFlow(info, current);
jumpHandler.forEachBreak((HBreak breakInstruction, _) {
HBasicBlock block = breakInstruction.block;
- block.addAtExit(new HBreak.toLabel(label));
+ block.addAtExit(new HBreak.toLabel(label, sourceInformation));
block.remove(breakInstruction);
});
}
@@ -1819,17 +1825,19 @@
assert(target != null);
JumpHandler handler = jumpTargets[target];
assert(handler != null);
+ SourceInformation sourceInformation =
+ _sourceInformationBuilder.buildGoto(node);
if (localsMap.generateContinueForBreak(node)) {
if (handler.labels.isNotEmpty) {
- handler.generateContinue(handler.labels.first);
+ handler.generateContinue(sourceInformation, handler.labels.first);
} else {
- handler.generateContinue();
+ handler.generateContinue(sourceInformation);
}
} else {
if (handler.labels.isNotEmpty) {
- handler.generateBreak(handler.labels.first);
+ handler.generateBreak(sourceInformation, handler.labels.first);
} else {
- handler.generateBreak();
+ handler.generateBreak(sourceInformation);
}
}
}
@@ -1903,7 +1911,8 @@
JumpHandler handler = jumpTargets[target];
assert(handler != null);
assert(target.labels.isNotEmpty);
- handler.generateContinue(target.labels.first);
+ handler.generateContinue(
+ _sourceInformationBuilder.buildGoto(node), target.labels.first);
}
@override
@@ -2036,17 +2045,21 @@
}
void buildSwitchCase(ir.SwitchCase switchCase) {
+ SourceInformation caseSourceInformation = sourceInformation;
if (switchCase != null) {
+ caseSourceInformation = _sourceInformationBuilder.buildGoto(switchCase);
// Generate 'target = i; break;' for switch case i.
int index = caseIndex[switchCase];
HInstruction value = graph.addConstantInt(index, closedWorld);
- localsHandler.updateLocal(switchTarget, value);
+ localsHandler.updateLocal(switchTarget, value,
+ sourceInformation: caseSourceInformation);
} else {
// Generate synthetic default case 'target = null; break;'.
HInstruction nullValue = graph.addConstantNull(closedWorld);
- localsHandler.updateLocal(switchTarget, nullValue);
+ localsHandler.updateLocal(switchTarget, nullValue,
+ sourceInformation: caseSourceInformation);
}
- jumpTargets[switchTarget].generateBreak();
+ jumpTargets[switchTarget].generateBreak(caseSourceInformation);
}
_handleSwitch(
@@ -2077,7 +2090,7 @@
if (!isAborted()) {
// Ensure that we break the loop if the case falls through. (This
// is only possible for the last case.)
- jumpTargets[switchTarget].generateBreak();
+ jumpTargets[switchTarget].generateBreak(sourceInformation);
}
}
@@ -2125,7 +2138,8 @@
node: switchStatement,
visitCondition: buildCondition,
visitThen: buildLoop,
- visitElse: () => {});
+ visitElse: () => {},
+ sourceInformation: sourceInformation);
}
}
@@ -2181,7 +2195,7 @@
// If there is no default, we will add one later to avoid
// the critical edge. So we generate a break statement to make
// sure the last case does not fall through to the default case.
- jumpHandler.generateBreak();
+ jumpHandler.generateBreak(sourceInformation);
}
statements.add(
new HSubGraphBlockInformation(new SubGraph(block, lastOpenedBlock)));
@@ -2558,8 +2572,12 @@
node.receiver.accept(this);
HInstruction receiver = pop();
- _pushDynamicInvocation(node, _typeInferenceMap.typeOfGet(node),
- <HInstruction>[receiver], _sourceInformationBuilder.buildGet(node));
+ _pushDynamicInvocation(
+ node,
+ _typeInferenceMap.typeOfGet(node),
+ new Selector.getter(_elementMap.getName(node.name)),
+ <HInstruction>[receiver],
+ _sourceInformationBuilder.buildGet(node));
}
@override
@@ -2586,6 +2604,7 @@
_pushDynamicInvocation(
node,
_typeInferenceMap.typeOfSet(node, closedWorld),
+ new Selector.setter(_elementMap.getName(node.name)),
<HInstruction>[receiver, value],
_sourceInformationBuilder.buildAssignment(node));
@@ -2600,10 +2619,12 @@
// Fake direct call with a dynamic call.
// TODO(sra): Implement direct invocations properly.
- _pushDynamicInvocation(node, _typeInferenceMap.typeOfDirectGet(node),
- <HInstruction>[receiver], _sourceInformationBuilder.buildGet(node),
- selector:
- new Selector.getter(_elementMap.getMember(node.target).memberName));
+ _pushDynamicInvocation(
+ node,
+ _typeInferenceMap.typeOfDirectGet(node),
+ new Selector.getter(_elementMap.getMember(node.target).memberName),
+ <HInstruction>[receiver],
+ _sourceInformationBuilder.buildGet(node));
}
@override
@@ -3515,10 +3536,53 @@
push(instruction);
}
- void _pushDynamicInvocation(ir.Node node, TypeMask mask,
- List<HInstruction> arguments, SourceInformation sourceInformation,
- {Selector selector}) {
- // TODO(redemption): Try to inline single targets.
+ void _pushDynamicInvocation(ir.Node node, TypeMask mask, Selector selector,
+ List<HInstruction> arguments, SourceInformation sourceInformation) {
+ // We prefer to not inline certain operations on indexables,
+ // because the constant folder will handle them better and turn
+ // them into simpler instructions that allow further
+ // optimizations.
+ bool isOptimizableOperationOnIndexable(
+ Selector selector, MemberEntity element) {
+ bool isLength = selector.isGetter && selector.name == "length";
+ if (isLength || selector.isIndex) {
+ return closedWorld.isSubtypeOf(
+ element.enclosingClass, commonElements.jsIndexableClass);
+ } else if (selector.isIndexSet) {
+ return closedWorld.isSubtypeOf(
+ element.enclosingClass, commonElements.jsMutableIndexableClass);
+ } else {
+ return false;
+ }
+ }
+
+ bool isOptimizableOperation(Selector selector, MemberEntity element) {
+ ClassEntity cls = element.enclosingClass;
+ if (isOptimizableOperationOnIndexable(selector, element)) return true;
+ if (!interceptorData.interceptedClasses.contains(cls)) return false;
+ if (selector.isOperator) return true;
+ if (selector.isSetter) return true;
+ if (selector.isIndex) return true;
+ if (selector.isIndexSet) return true;
+ if (element == commonElements.jsArrayAdd ||
+ element == commonElements.jsArrayRemoveLast ||
+ element == commonElements.jsStringSplit) {
+ return true;
+ }
+ return false;
+ }
+
+ MemberEntity element = closedWorld.locateSingleElement(selector, mask);
+ if (element != null &&
+ !element.isField &&
+ !(element.isGetter && selector.isCall) &&
+ !(element.isFunction && selector.isGetter) &&
+ !isOptimizableOperation(selector, element)) {
+ if (_tryInlineMethod(
+ element, selector, mask, arguments, node, sourceInformation)) {
+ return;
+ }
+ }
HInstruction receiver = arguments.first;
List<HInstruction> inputs = <HInstruction>[];
@@ -3682,7 +3746,6 @@
funcExpression.function.accept(this);
}
- // TODO(het): Decide when to inline
@override
void visitMethodInvocation(ir.MethodInvocation invocation) {
invocation.receiver.accept(this);
@@ -3691,6 +3754,7 @@
_pushDynamicInvocation(
invocation,
_typeInferenceMap.typeOfInvocation(invocation, closedWorld),
+ selector,
<HInstruction>[receiver]..addAll(
_visitArgumentsForDynamicTarget(selector, invocation.arguments)),
_sourceInformationBuilder.buildCall(invocation.receiver, invocation));
diff --git a/pkg/compiler/lib/src/ssa/jump_handler.dart b/pkg/compiler/lib/src/ssa/jump_handler.dart
index aa6f45a..d8dc2ee 100644
--- a/pkg/compiler/lib/src/ssa/jump_handler.dart
+++ b/pkg/compiler/lib/src/ssa/jump_handler.dart
@@ -4,6 +4,7 @@
import '../common.dart';
import '../elements/jumps.dart';
+import '../io/source_information.dart';
import '../tree/tree.dart' as ast;
import 'graph_builder.dart';
@@ -23,8 +24,10 @@
factory JumpHandler(GraphBuilder builder, JumpTarget target) {
return new TargetJumpHandler(builder, target);
}
- void generateBreak([LabelDefinition label]);
- void generateContinue([LabelDefinition label]);
+ void generateBreak(SourceInformation sourceInformation,
+ [LabelDefinition label]);
+ void generateContinue(SourceInformation sourceInformation,
+ [LabelDefinition label]);
void forEachBreak(void action(HBreak instruction, LocalsHandler locals));
void forEachContinue(
void action(HContinue instruction, LocalsHandler locals));
@@ -43,12 +46,14 @@
NullJumpHandler(this.reporter);
- void generateBreak([LabelDefinition label]) {
+ void generateBreak(SourceInformation sourceInformation,
+ [LabelDefinition label]) {
reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
'NullJumpHandler.generateBreak should not be called.');
}
- void generateContinue([LabelDefinition label]) {
+ void generateContinue(SourceInformation sourceInformation,
+ [LabelDefinition label]) {
reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
'NullJumpHandler.generateContinue should not be called.');
}
@@ -79,24 +84,26 @@
builder.jumpTargets[target] = this;
}
- void generateBreak([LabelDefinition label]) {
+ void generateBreak(SourceInformation sourceInformation,
+ [LabelDefinition label]) {
HInstruction breakInstruction;
if (label == null) {
- breakInstruction = new HBreak(target);
+ breakInstruction = new HBreak(target, sourceInformation);
} else {
- breakInstruction = new HBreak.toLabel(label);
+ breakInstruction = new HBreak.toLabel(label, sourceInformation);
}
LocalsHandler locals = new LocalsHandler.from(builder.localsHandler);
builder.close(breakInstruction);
jumps.add(new _JumpHandlerEntry(breakInstruction, locals));
}
- void generateContinue([LabelDefinition label]) {
+ void generateContinue(SourceInformation sourceInformation,
+ [LabelDefinition label]) {
HInstruction continueInstruction;
if (label == null) {
- continueInstruction = new HContinue(target);
+ continueInstruction = new HContinue(target, sourceInformation);
} else {
- continueInstruction = new HContinue.toLabel(label);
+ continueInstruction = new HContinue.toLabel(label, sourceInformation);
// Switch case continue statements must be handled by the
// [SwitchCaseJumpHandler].
assert(!label.target.isSwitchCase);
@@ -157,19 +164,20 @@
SwitchCaseJumpHandler(GraphBuilder builder, JumpTarget target)
: super(builder, target);
- void generateBreak([LabelDefinition label]) {
+ void generateBreak(SourceInformation sourceInformation,
+ [LabelDefinition label]) {
if (label == null) {
// Creates a special break instruction for the synthetic loop generated
// for a switch statement with continue statements. See
// [SsaFromAstMixin.buildComplexSwitchStatement] for detail.
HInstruction breakInstruction =
- new HBreak(target, breakSwitchContinueLoop: true);
+ new HBreak(target, sourceInformation, breakSwitchContinueLoop: true);
LocalsHandler locals = new LocalsHandler.from(builder.localsHandler);
builder.close(breakInstruction);
jumps.add(new _JumpHandlerEntry(breakInstruction, locals));
} else {
- super.generateBreak(label);
+ super.generateBreak(sourceInformation, label);
}
}
@@ -177,7 +185,8 @@
return label != null && targetIndexMap.containsKey(label.target);
}
- void generateContinue([LabelDefinition label]) {
+ void generateContinue(SourceInformation sourceInformation,
+ [LabelDefinition label]) {
if (isContinueToSwitchCase(label)) {
// Creates the special instructions 'label = i; continue l;' used in
// switch statements with continue statements. See
@@ -189,12 +198,13 @@
builder.localsHandler.updateLocal(target, value);
assert(label.target.labels.contains(label));
- HInstruction continueInstruction = new HContinue(target);
+ HInstruction continueInstruction =
+ new HContinue(target, sourceInformation);
LocalsHandler locals = new LocalsHandler.from(builder.localsHandler);
builder.close(continueInstruction);
jumps.add(new _JumpHandlerEntry(continueInstruction, locals));
} else {
- super.generateContinue(label);
+ super.generateContinue(sourceInformation, label);
}
}
diff --git a/pkg/compiler/lib/src/ssa/loop_handler.dart b/pkg/compiler/lib/src/ssa/loop_handler.dart
index 719ab91..4bace0e 100644
--- a/pkg/compiler/lib/src/ssa/loop_handler.dart
+++ b/pkg/compiler/lib/src/ssa/loop_handler.dart
@@ -210,7 +210,7 @@
jumpHandler.forEachBreak((HBreak breakInstruction, _) {
HBasicBlock block = breakInstruction.block;
- block.addAtExit(new HBreak.toLabel(label));
+ block.addAtExit(new HBreak.toLabel(label, sourceInformation));
block.remove(breakInstruction);
});
}
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index 45be84a..a373b52 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -1850,7 +1850,14 @@
// The 'inputs' are
// [receiver, arg1, ..., argN] or
// [interceptor, receiver, arg1, ... argN].
- HInvokeConstructorBody(element, inputs, type) : super(element, inputs, type);
+ HInvokeConstructorBody(
+ ConstructorBodyEntity element,
+ List<HInstruction> inputs,
+ TypeMask type,
+ SourceInformation sourceInformation)
+ : super(element, inputs, type) {
+ this.sourceInformation = sourceInformation;
+ }
String toString() => 'invoke constructor body: ${element.name}';
accept(HVisitor visitor) => visitor.visitInvokeConstructorBody(this);
@@ -2368,13 +2375,17 @@
abstract class HJump extends HControlFlow {
final JumpTarget target;
final LabelDefinition label;
- HJump(this.target)
+ HJump(this.target, SourceInformation sourceInformation)
: label = null,
- super(const <HInstruction>[]);
- HJump.toLabel(LabelDefinition label)
+ super(const <HInstruction>[]) {
+ this.sourceInformation = sourceInformation;
+ }
+ HJump.toLabel(LabelDefinition label, SourceInformation sourceInformation)
: label = label,
target = label.target,
- super(const <HInstruction>[]);
+ super(const <HInstruction>[]) {
+ this.sourceInformation = sourceInformation;
+ }
}
class HBreak extends HJump {
@@ -2382,19 +2393,30 @@
/// generated for a switch statement with continue statements. See
/// [SsaFromAstMixin.buildComplexSwitchStatement] for detail.
final bool breakSwitchContinueLoop;
- HBreak(JumpTarget target, {bool this.breakSwitchContinueLoop: false})
- : super(target);
- HBreak.toLabel(LabelDefinition label)
+
+ HBreak(JumpTarget target, SourceInformation sourceInformation,
+ {bool this.breakSwitchContinueLoop: false})
+ : super(target, sourceInformation);
+
+ HBreak.toLabel(LabelDefinition label, SourceInformation sourceInformation)
: breakSwitchContinueLoop = false,
- super.toLabel(label);
- toString() => (label != null) ? 'break ${label.labelName}' : 'break';
+ super.toLabel(label, sourceInformation);
+
+ String toString() => (label != null) ? 'break ${label.labelName}' : 'break';
+
accept(HVisitor visitor) => visitor.visitBreak(this);
}
class HContinue extends HJump {
- HContinue(JumpTarget target) : super(target);
- HContinue.toLabel(LabelDefinition label) : super.toLabel(label);
- toString() => (label != null) ? 'continue ${label.labelName}' : 'continue';
+ HContinue(JumpTarget target, SourceInformation sourceInformation)
+ : super(target, sourceInformation);
+
+ HContinue.toLabel(LabelDefinition label, SourceInformation sourceInformation)
+ : super.toLabel(label, sourceInformation);
+
+ String toString() =>
+ (label != null) ? 'continue ${label.labelName}' : 'continue';
+
accept(HVisitor visitor) => visitor.visitContinue(this);
}
diff --git a/pkg/compiler/tool/status_files/update_from_log.dart b/pkg/compiler/tool/status_files/update_from_log.dart
index d934f20..9f875fa 100644
--- a/pkg/compiler/tool/status_files/update_from_log.dart
+++ b/pkg/compiler/tool/status_files/update_from_log.dart
@@ -247,7 +247,26 @@
}
int begin = contents.indexOf('\n', sectionDeclaration) + 1;
assert(begin != 0);
- int end = contents.indexOf('\n[', begin + 1);
+ int newlinePos = contents.indexOf('\n', begin + 1);
+ int end = newlinePos;
+ while (true) {
+ if (newlinePos == -1) break;
+ if (newlinePos + 1 < contents.length) {
+ if (contents[newlinePos + 1] == '[') {
+ // We've found the end of the section
+ break;
+ } else if (contents[newlinePos + 1] == '#') {
+ // We've found a commented out line. This line might belong to the
+ // next section.
+ newlinePos = contents.indexOf('\n', newlinePos + 1);
+ continue;
+ }
+ }
+ // We've found an ordinary line. It's part of this section, so update
+ // end.
+ newlinePos = contents.indexOf('\n', newlinePos + 1);
+ end = newlinePos;
+ }
end = end == -1 ? contents.length : end + 1;
return new ConfigurationInSuiteSection(
suite, statusFile, contents, begin, end);
diff --git a/pkg/dev_compiler/lib/src/analyzer/code_generator.dart b/pkg/dev_compiler/lib/src/analyzer/code_generator.dart
index f2ac0ed..1b60aec 100644
--- a/pkg/dev_compiler/lib/src/analyzer/code_generator.dart
+++ b/pkg/dev_compiler/lib/src/analyzer/code_generator.dart
@@ -5091,7 +5091,8 @@
_emitNormalFormalParameter(node);
@override
- JS.This visitThisExpression(ThisExpression node) => new JS.This();
+ JS.This visitThisExpression(ThisExpression node) =>
+ new JS.This()..sourceInformation = node;
@override
JS.Expression visitSuperExpression(SuperExpression node) => new JS.Super();
@@ -5849,7 +5850,11 @@
}
useExtension ??= _isSymbolizedMember(type, name);
- name = JS.memberNameForDartMember(name);
+ // Rename members that conflict with standard JS members unless we are
+ // actually try to access those JS members via interop.
+ var isExternal = element != null &&
+ !(element is ExecutableElement && !element.isExternal);
+ name = JS.memberNameForDartMember(name, isExternal);
if (useExtension) {
return _getExtensionSymbolInternal(name);
}
diff --git a/pkg/dev_compiler/lib/src/compiler/js_names.dart b/pkg/dev_compiler/lib/src/compiler/js_names.dart
index bb6d03e..8db3036 100644
--- a/pkg/dev_compiler/lib/src/compiler/js_names.dart
+++ b/pkg/dev_compiler/lib/src/compiler/js_names.dart
@@ -322,7 +322,7 @@
/// Returns the JS member name for a public Dart instance member, before it
/// is symbolized; generally you should use [_emitMemberName] or
/// [_declareMemberName] instead of this.
-String memberNameForDartMember(String name) {
+String memberNameForDartMember(String name, [bool isExternal = false]) {
// When generating synthetic names, we use _ as the prefix, since Dart names
// won't have this, nor will static names reach here.
switch (name) {
@@ -336,7 +336,8 @@
return '_equals';
case 'constructor':
case 'prototype':
- return '_$name';
+ // If [isExternal], assume the JS member is intended.
+ return isExternal ? name : '_$name';
}
return name;
}
diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart
index cdf4d77..6e97625 100644
--- a/pkg/dev_compiler/lib/src/kernel/compiler.dart
+++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart
@@ -2158,6 +2158,8 @@
}
useExtension ??= _isSymbolizedMember(type, name);
+ // TODO(vsm): Do not rename members that conflict with standard JS members
+ // if we are actually try to access those JS members via interop.
name = JS.memberNameForDartMember(name);
if (useExtension) {
return _getExtensionSymbolInternal(name);
diff --git a/pkg/dev_compiler/tool/kernel_sdk.dart b/pkg/dev_compiler/tool/kernel_sdk.dart
index ac35ee2..b16bd46 100755
--- a/pkg/dev_compiler/tool/kernel_sdk.dart
+++ b/pkg/dev_compiler/tool/kernel_sdk.dart
@@ -5,6 +5,7 @@
import 'dart:io';
import 'dart:async';
+import 'package:args/args.dart' show ArgParser;
import 'package:dev_compiler/src/compiler/module_builder.dart';
import 'package:dev_compiler/src/kernel/target.dart';
import 'package:dev_compiler/src/kernel/command.dart';
@@ -15,10 +16,18 @@
import 'patch_sdk.dart' as patch_sdk;
Future main(List<String> args) async {
+ // Parse flags.
+ var parser = new ArgParser()
+ ..addFlag('generate-javascript',
+ help: 'Generate JavaScript (in addition to dill)', abbr: 'g');
+ var parserOptions = parser.parse(args);
+ var generateJS = parserOptions['generate-javascript'] as bool;
+ var rest = parserOptions.rest;
+
Directory.current = path.dirname(path.dirname(path.fromUri(Platform.script)));
var outputPath =
- path.absolute(args.length > 0 ? args[0] : 'lib/sdk/ddc_sdk.dill');
+ path.absolute(rest.length > 0 ? rest[0] : 'gen/sdk/ddc_sdk.dill');
patch_sdk.main(['../..', 'tool/input_sdk', 'gen/patched_sdk']);
@@ -38,7 +47,6 @@
// writeProgramToText(program);
await writeProgramToBinary(program, outputPath);
- bool generateJS = false;
if (generateJS) {
var jsModule = compileToJSModule(program, [], [], {});
var jsPath = path.join(path.basename(outputPath), 'dart_sdk.kernel.js');
diff --git a/pkg/front_end/lib/src/api_prototype/compiler_options.dart b/pkg/front_end/lib/src/api_prototype/compiler_options.dart
index 4927af0..6b66316 100644
--- a/pkg/front_end/lib/src/api_prototype/compiler_options.dart
+++ b/pkg/front_end/lib/src/api_prototype/compiler_options.dart
@@ -97,18 +97,6 @@
/// at a default location within [sdkRoot].
Uri sdkSummary;
- /// Multi-roots.
- ///
- /// Any Uri that resolves to "multi-root:///$absolute_path" will be searched
- /// for at "$root/$absolute_path", where "$root" is drawn from this list.
- ///
- /// Intended use: if the user has a Bazel workspace located at path
- /// "$workspace", this could be set to the file URIs corresponding to the
- /// paths for "$workspace", "$workspace/bazel-bin",
- /// and "$workspace/bazel-genfiles", effectively overlaying source and
- /// generated files.
- List<Uri> multiRoots = [];
-
/// The declared variables for use by configurable imports and constant
/// evaluation.
Map<String, String> declaredVariables;
diff --git a/pkg/front_end/lib/src/api_unstable/compiler_state.dart b/pkg/front_end/lib/src/api_unstable/compiler_state.dart
new file mode 100644
index 0000000..f950fe1
--- /dev/null
+++ b/pkg/front_end/lib/src/api_unstable/compiler_state.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:front_end/src/base/processed_options.dart';
+
+import '../api_prototype/compiler_options.dart';
+import '../base/processed_options.dart';
+
+class InitializedCompilerState {
+ final CompilerOptions options;
+ final ProcessedOptions processedOpts;
+
+ InitializedCompilerState(this.options, this.processedOpts);
+}
diff --git a/pkg/front_end/lib/src/api_unstable/dart2js.dart b/pkg/front_end/lib/src/api_unstable/dart2js.dart
new file mode 100644
index 0000000..b7915a8
--- /dev/null
+++ b/pkg/front_end/lib/src/api_unstable/dart2js.dart
@@ -0,0 +1,70 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async' show Future;
+
+import 'package:front_end/src/base/processed_options.dart';
+import 'package:front_end/src/fasta/scanner/token.dart' show StringToken;
+import 'package:front_end/src/kernel_generator_impl.dart';
+import 'package:kernel/kernel.dart' show Program;
+import 'package:kernel/target/targets.dart' show Target;
+
+import '../api_prototype/compiler_options.dart';
+import '../api_prototype/file_system.dart';
+import '../base/processed_options.dart';
+import '../fasta/compiler_context.dart';
+import '../fasta/fasta_codes.dart';
+import '../fasta/severity.dart';
+import '../kernel_generator_impl.dart';
+import 'compiler_state.dart';
+
+export 'compiler_state.dart';
+
+InitializedCompilerState initializeCompiler(InitializedCompilerState oldState,
+ Target target, Uri sdkUri, Uri packagesFileUri) {
+ if (oldState != null &&
+ oldState.options.packagesFileUri == packagesFileUri &&
+ oldState.options.linkedDependencies[0] == sdkUri) {
+ return oldState;
+ }
+
+ CompilerOptions options = new CompilerOptions()
+ ..target = target
+ ..linkedDependencies = [sdkUri]
+ ..packagesFileUri = packagesFileUri;
+
+ ProcessedOptions processedOpts = new ProcessedOptions(options, false, []);
+
+ return new InitializedCompilerState(options, processedOpts);
+}
+
+Future<Program> compile(InitializedCompilerState state, bool verbose,
+ FileSystem fileSystem, ErrorHandler onError, Uri input) async {
+ CompilerOptions options = state.options;
+ options
+ ..onError = onError
+ ..verbose = verbose
+ ..fileSystem = fileSystem;
+
+ ProcessedOptions processedOpts = state.processedOpts;
+ processedOpts.inputs.clear();
+ processedOpts.inputs.add(input);
+ processedOpts.clearFileSystemCache();
+ StringToken.canonicalizer.clear();
+
+ var compilerResult = await CompilerContext.runWithOptions(processedOpts,
+ (CompilerContext context) async {
+ var compilerResult = await generateKernelInternal();
+ Program program = compilerResult?.program;
+ if (program == null) return null;
+ if (program.mainMethod == null) {
+ context.options
+ .report(messageMissingMain.withLocation(input, -1), Severity.error);
+ return null;
+ }
+ return compilerResult;
+ });
+
+ return compilerResult?.program;
+}
diff --git a/pkg/front_end/lib/src/api_unstable/ddc.dart b/pkg/front_end/lib/src/api_unstable/ddc.dart
index 158fd59..18ea8cf 100644
--- a/pkg/front_end/lib/src/api_unstable/ddc.dart
+++ b/pkg/front_end/lib/src/api_unstable/ddc.dart
@@ -4,13 +4,18 @@
import 'dart:async' show Future;
+import 'package:front_end/src/api_prototype/physical_file_system.dart';
import 'package:front_end/src/base/processed_options.dart';
import 'package:front_end/src/fasta/scanner/token.dart' show StringToken;
import 'package:front_end/src/kernel_generator_impl.dart';
+import 'package:front_end/src/multi_root_file_system.dart';
import 'package:kernel/kernel.dart' show Program;
import 'package:kernel/target/targets.dart' show Target;
import '../api_prototype/compiler_options.dart';
+import 'compiler_state.dart';
+
+export 'compiler_state.dart';
export '../api_prototype/compilation_message.dart';
@@ -21,13 +26,6 @@
DdcResult(this.program, this.inputSummaries);
}
-class InitializedCompilerState {
- final CompilerOptions options;
- final ProcessedOptions processedOpts;
-
- InitializedCompilerState(this.options, this.processedOpts);
-}
-
Future<InitializedCompilerState> initializeCompiler(
InitializedCompilerState oldState,
Uri sdkSummary,
@@ -65,11 +63,23 @@
return oldState;
}
+ // To make the output .dill agnostic of the current working directory,
+ // we use a custom-uri scheme for all app URIs (these are files outside the
+ // lib folder). The following [FileSystem] will resolve those references to
+ // the correct location and keeps the real file location hidden from the
+ // front end.
+ // TODO(sigmund): technically we don't need a "multi-root" file system,
+ // because we are providing a single root, the alternative here is to
+ // implement a new file system with a single root instead.
+ var fileSystem = new MultiRootFileSystem(
+ 'org-dartlang-app', [Uri.base], PhysicalFileSystem.instance);
+
CompilerOptions options = new CompilerOptions()
..sdkSummary = sdkSummary
..packagesFileUri = packagesFile
..inputSummaries = inputSummaries
..target = target
+ ..fileSystem = fileSystem
..chaseDependencies = true
..reportMessages = true;
diff --git a/pkg/front_end/lib/src/base/processed_options.dart b/pkg/front_end/lib/src/base/processed_options.dart
index 1e8a345..7c45480 100644
--- a/pkg/front_end/lib/src/base/processed_options.dart
+++ b/pkg/front_end/lib/src/base/processed_options.dart
@@ -15,7 +15,6 @@
import 'package:front_end/src/fasta/ticker.dart';
import 'package:front_end/src/fasta/uri_translator.dart';
import 'package:front_end/src/fasta/uri_translator_impl.dart';
-import 'package:front_end/src/multi_root_file_system.dart';
import 'package:kernel/kernel.dart' show Program, CanonicalName;
import 'package:kernel/target/targets.dart';
import 'package:kernel/target/vm.dart';
@@ -236,11 +235,12 @@
/// Get the [FileSystem] which should be used by the front end to access
/// files.
- ///
- /// If the client supplied roots using [CompilerOptions.multiRoots], the
- /// returned [FileSystem] will automatically perform the appropriate mapping.
FileSystem get fileSystem => _fileSystem ??= _createFileSystem();
+ /// Clear the file system so any CompilerOptions fileSystem change will have
+ /// effect.
+ void clearFileSystemCache() => _fileSystem = null;
+
/// Whether to interpret Dart sources in strong-mode.
bool get strongMode => _raw.strongMode;
@@ -494,16 +494,10 @@
/// Create a [FileSystem] specific to the current options.
///
- /// If `_raw.multiRoots` is not empty, the file-system will implement the
- /// semantics of multiple roots. If [chaseDependencies] is false, the
- /// resulting file system will be hermetic.
+ /// If [chaseDependencies] is false, the resulting file system will be
+ /// hermetic.
FileSystem _createFileSystem() {
var result = _raw.fileSystem;
- // Note: hermetic checks are done before translating multi-root URIs, so
- // the order in which we create the file systems below is relevant.
- if (!_raw.multiRoots.isEmpty) {
- result = new MultiRootFileSystem('multi-root', _raw.multiRoots, result);
- }
if (!chaseDependencies) {
var allInputs = inputs.toSet();
allInputs.addAll(_raw.inputSummaries);
@@ -550,7 +544,6 @@
writeList('Input Summaries', _raw.inputSummaries);
writeList('Linked Dependencies', _raw.linkedDependencies);
- writeList('Multiroots', _raw.multiRoots);
sb.writeln('Modular: ${_modularApi}');
sb.writeln('Hermetic: ${!chaseDependencies} (provided: '
diff --git a/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart b/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
index a9acecf..d78c011 100644
--- a/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
+++ b/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
@@ -3511,6 +3511,7 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageRequiredParameterWithDefault = const MessageCode(
"RequiredParameterWithDefault",
+ analyzerCode: "NAMED_PARAMETER_OUTSIDE_GROUP",
dart2jsCode: "REQUIRED_PARAMETER_WITH_DEFAULT",
message: r"""Non-optional parameters can't have a default value.""",
tip:
@@ -4065,6 +4066,105 @@
message: r"""Can't create typedef from non-function type.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+ Message Function(
+ String name,
+ DartType
+ _type)> templateUndefinedGetter = const Template<
+ Message Function(String name, DartType _type)>(
+ messageTemplate:
+ r"""The getter '#name' isn't defined for the class '#type'.""",
+ tipTemplate:
+ r"""Try correcting the name to the name of an existing getter, or defining a getter or field named '#name'.""",
+ withArguments: _withArgumentsUndefinedGetter);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(String name, DartType _type)> codeUndefinedGetter =
+ const Code<Message Function(String name, DartType _type)>(
+ "UndefinedGetter", templateUndefinedGetter,
+ analyzerCode: "UNDEFINED_GETTER", dart2jsCode: "*ignored*");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsUndefinedGetter(String name, DartType _type) {
+ NameSystem nameSystem = new NameSystem();
+ StringBuffer buffer = new StringBuffer();
+ new Printer(buffer, syntheticNames: nameSystem).writeNode(_type);
+ String type = '$buffer';
+
+ return new Message(codeUndefinedGetter,
+ message: """The getter '$name' isn't defined for the class '$type'.""",
+ tip:
+ """Try correcting the name to the name of an existing getter, or defining a getter or field named '$name'.""",
+ arguments: {'name': name, 'type': _type});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+ Message Function(
+ String name,
+ DartType
+ _type)> templateUndefinedMethod = const Template<
+ Message Function(String name, DartType _type)>(
+ messageTemplate:
+ r"""The method '#name' isn't defined for the class '#type'.""",
+ tipTemplate:
+ r"""Try correcting the name to the name of an existing method, or defining a method named '#name'.""",
+ withArguments: _withArgumentsUndefinedMethod);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(String name, DartType _type)> codeUndefinedMethod =
+ const Code<Message Function(String name, DartType _type)>(
+ "UndefinedMethod", templateUndefinedMethod,
+ analyzerCode: "UNDEFINED_METHOD", dart2jsCode: "*ignored*");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsUndefinedMethod(String name, DartType _type) {
+ NameSystem nameSystem = new NameSystem();
+ StringBuffer buffer = new StringBuffer();
+ new Printer(buffer, syntheticNames: nameSystem).writeNode(_type);
+ String type = '$buffer';
+
+ return new Message(codeUndefinedMethod,
+ message: """The method '$name' isn't defined for the class '$type'.""",
+ tip:
+ """Try correcting the name to the name of an existing method, or defining a method named '$name'.""",
+ arguments: {'name': name, 'type': _type});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+ Message Function(
+ String name,
+ DartType
+ _type)> templateUndefinedSetter = const Template<
+ Message Function(String name, DartType _type)>(
+ messageTemplate:
+ r"""The setter '#name' isn't defined for the class '#type'.""",
+ tipTemplate:
+ r"""Try correcting the name to the name of an existing setter, or defining a setter or field named '#name'.""",
+ withArguments: _withArgumentsUndefinedSetter);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(String name, DartType _type)> codeUndefinedSetter =
+ const Code<Message Function(String name, DartType _type)>(
+ "UndefinedSetter", templateUndefinedSetter,
+ analyzerCode: "UNDEFINED_SETTER", dart2jsCode: "*ignored*");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsUndefinedSetter(String name, DartType _type) {
+ NameSystem nameSystem = new NameSystem();
+ StringBuffer buffer = new StringBuffer();
+ new Printer(buffer, syntheticNames: nameSystem).writeNode(_type);
+ String type = '$buffer';
+
+ return new Message(codeUndefinedSetter,
+ message: """The setter '$name' isn't defined for the class '$type'.""",
+ tip:
+ """Try correcting the name to the name of an existing setter, or defining a setter or field named '$name'.""",
+ arguments: {'name': name, 'type': _type});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeUnexpectedDollarInString = messageUnexpectedDollarInString;
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -4139,6 +4239,7 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageUnsupportedPrefixPlus = const MessageCode(
"UnsupportedPrefixPlus",
+ analyzerCode: "MISSING_IDENTIFIER",
dart2jsCode: "UNSUPPORTED_PREFIX_PLUS",
message: r"""'+' is not a prefix operator.""",
tip: r"""Try removing '+'.""");
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 e2aebdf..7ed8dc5 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -932,7 +932,8 @@
Expression argument = popForValue();
Expression receiver = pop();
var logicalExpression =
- new ShadowLogicalExpression(receiver, token.stringValue, argument);
+ new ShadowLogicalExpression(receiver, token.stringValue, argument)
+ ..fileOffset = offsetForToken(token);
typePromoter.exitLogicalExpression(argument, logicalExpression);
push(logicalExpression);
}
@@ -948,7 +949,8 @@
buildIsNull(new VariableGet(variable), offsetForToken(token)),
b,
new VariableGet(variable),
- null)));
+ null))
+ ..fileOffset = offsetForToken(token));
}
/// Handle `a?.b(...)`.
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index baaa720..de4ebb4 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -749,7 +749,6 @@
@override
void _inferStatement(ShadowTypeInferrer inferrer) {
- inferrer.listener.forInStatementEnter(this);
var iterableClass = isAsync
? inferrer.coreTypes.streamClass
: inferrer.coreTypes.iterableClass;
@@ -758,6 +757,7 @@
bool typeChecksNeeded = !inferrer.isTopLevel;
ShadowVariableDeclaration variable;
var syntheticAssignment = _syntheticAssignment;
+ Expression syntheticWrite;
if (_declaresVariable) {
variable = this.variable;
if (inferrer.strongMode && variable._implicitlyTyped) {
@@ -767,11 +767,13 @@
context = variable.type;
}
} else if (syntheticAssignment is ShadowComplexAssignment) {
+ syntheticWrite = syntheticAssignment.write;
context = syntheticAssignment._getWriteType(inferrer);
} else {
context = const UnknownType();
}
context = inferrer.wrapType(context, iterableClass);
+ inferrer.listener.forInStatementEnter(this, variable, syntheticWrite);
var inferredExpressionType = inferrer.resolveTypeParameter(inferrer
.inferExpression(iterable, context, typeNeeded || typeChecksNeeded));
inferrer.checkAssignability(
@@ -812,7 +814,7 @@
body = combineStatements(variable, body)..parent = this;
}
}
- inferrer.listener.forInStatementExit(this);
+ inferrer.listener.forInStatementExit(this, variable);
}
}
@@ -917,6 +919,7 @@
if (inferrer.strongMode) {
variable.type = lhsType;
}
+ inferrer.listener.ifNullBeforeRhs(this);
// - Let J = T0 if K is `_` else K.
var rhsContext = typeContext ?? lhsType;
// - Infer e1 in context J to get T1
@@ -1137,7 +1140,8 @@
inferrer.listener.isNotExpressionEnter(this, typeContext) || typeNeeded;
inferrer.inferExpression(isExpression.operand, null, false);
var inferredType = typeNeeded ? inferrer.coreTypes.boolClass.rawType : null;
- inferrer.listener.isNotExpressionExit(this, inferredType);
+ inferrer.listener
+ .isNotExpressionExit(this, isExpression.type, inferredType);
return inferredType;
}
}
@@ -1243,6 +1247,7 @@
var boolType = inferrer.coreTypes.boolClass.rawType;
var leftType =
inferrer.inferExpression(left, boolType, !inferrer.isTopLevel);
+ inferrer.listener.logicalExpressionBeforeRhs(this);
var rightType =
inferrer.inferExpression(right, boolType, !inferrer.isTopLevel);
inferrer.checkAssignability(boolType, leftType, left, left.fileOffset);
@@ -1712,7 +1717,8 @@
@override
DartType _inferExpression(
ShadowTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
- typeNeeded = inferrer.listener.staticAssignEnter(desugared, typeContext) ||
+ typeNeeded = inferrer.listener
+ .staticAssignEnter(desugared, this.write, typeContext) ||
typeNeeded;
DartType readType;
var read = this.read;
@@ -1720,18 +1726,20 @@
readType = read.target.getterType;
_storeLetType(inferrer, read, readType);
}
+ Member writeMember;
DartType writeContext;
var write = this.write;
if (write is StaticSet) {
writeContext = write.target.setterType;
- var target = write.target;
- if (target is ShadowField && target._inferenceNode != null) {
- target._inferenceNode.resolve();
- target._inferenceNode = null;
+ writeMember = write.target;
+ if (writeMember is ShadowField && writeMember._inferenceNode != null) {
+ writeMember._inferenceNode.resolve();
+ writeMember._inferenceNode = null;
}
}
var inferredResult = _inferRhs(inferrer, readType, writeContext);
- inferrer.listener.staticAssignExit(desugared, inferredResult.type);
+ inferrer.listener.staticAssignExit(desugared, write, writeMember,
+ writeContext, inferredResult.combiner, inferredResult.type);
_replaceWithDesugared();
return inferredResult.type;
}
diff --git a/pkg/front_end/lib/src/fasta/parser/modifier_context.dart b/pkg/front_end/lib/src/fasta/parser/modifier_context.dart
index b8c2cb27..75091be 100644
--- a/pkg/front_end/lib/src/fasta/parser/modifier_context.dart
+++ b/pkg/front_end/lib/src/fasta/parser/modifier_context.dart
@@ -739,14 +739,14 @@
class TopLevelMethodModifierContext {
final Parser parser;
- Token name;
+ Token beforeName;
Token externalToken;
/// If recovery finds the beginning of a new declaration,
/// then this is set to the last token in the prior declaration.
Token endInvalidTopLevelDeclarationToken;
- TopLevelMethodModifierContext(this.parser, this.name);
+ TopLevelMethodModifierContext(this.parser, this.beforeName);
/// Parse modifiers from the token following [token] up to but not including
/// [afterModifiers]. If a new declaration start is found in the sequence of
@@ -756,7 +756,9 @@
Token parseRecovery(Token token, Token afterModifiers) {
assert(token != afterModifiers && token.next != afterModifiers);
+ Token beforeToken = token;
while (token.next != afterModifiers) {
+ beforeToken = token;
token = token.next;
if (optional('external', token)) {
if (externalToken == null) {
@@ -773,25 +775,27 @@
Token next = token.next;
if (next.isTopLevelKeyword) {
endInvalidTopLevelDeclarationToken = token;
- return token;
+ return beforeToken;
}
if (next.isOperator) {
// If the operator is not one of the modifiers, then skip it,
// and insert a synthetic modifier
// to be interpreted as the top level function's identifier.
if (identical(next, afterModifiers)) {
- name = parser.rewriter.insertToken(
+ beforeName = next;
+ parser.rewriter.insertToken(
new SyntheticStringToken(
TokenType.IDENTIFIER,
'#synthetic_function_${next.charOffset}',
token.charOffset,
0),
next.next);
- return name;
+ return next;
}
// If the next token is an operator, then skip it
// because the error message above says it all.
- token = token.next;
+ beforeToken = token;
+ token = token;
}
} else if (optional('factory', token)) {
parser.reportRecoverableError(
@@ -799,13 +803,13 @@
// Indicate to the caller that the next token should be
// parsed as a new top level declaration.
endInvalidTopLevelDeclarationToken = token;
- return token;
+ return beforeToken;
} else {
// TODO(danrubel): report more specific analyzer error codes
parser.reportRecoverableErrorWithToken(
token, fasta.templateExtraneousModifier);
}
}
- return token;
+ return beforeToken;
}
}
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
index 4d98840..1c2887c 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -34,8 +34,8 @@
EOF_TOKEN,
EQ_TOKEN,
FUNCTION_TOKEN,
- GT_TOKEN,
GT_GT_TOKEN,
+ GT_TOKEN,
HASH_TOKEN,
HEXADECIMAL_TOKEN,
IDENTIFIER_TOKEN,
@@ -1681,6 +1681,8 @@
List<String> followingValues;
if (context == IdentifierContext.classOrNamedMixinDeclaration) {
followingValues = ['<', 'extends', 'with', 'implements', '{'];
+ } else if (context == IdentifierContext.combinator) {
+ followingValues = [';'];
} else if (context == IdentifierContext.fieldDeclaration) {
followingValues = [';', '=', ','];
} else if (context == IdentifierContext.enumDeclaration) {
@@ -2548,7 +2550,7 @@
return parseStuff(
token,
(t) => listener.beginTypeArguments(t),
- (t) => parseType(t).next,
+ (t) => parseType(t),
(c, bt, et) => listener.endTypeArguments(c, bt, et),
(t) => listener.handleNoTypeArguments(t));
}
@@ -2557,7 +2559,7 @@
return parseStuff(
token,
(t) => listener.beginTypeVariables(t),
- (t) => parseTypeVariable(t).next,
+ (t) => parseTypeVariable(t),
(c, bt, et) => listener.endTypeVariables(c, bt, et),
(t) => listener.handleNoTypeVariables(t));
}
@@ -2571,30 +2573,34 @@
token = listener.injectGenericCommentTypeList(token.next).previous;
Token next = token.next;
if (optional('<', next)) {
- token = next;
- Token begin = token;
+ Token begin = next;
beginStuff(begin);
int count = 0;
do {
- token = stuffParser(token);
+ token = stuffParser(token.next);
++count;
- } while (optional(',', token));
+ } while (optional(',', token.next));
// Rewrite `>>`, `>=`, and `>>=` tokens
- String value = token.stringValue;
+ next = token.next;
+ String value = next.stringValue;
if (value != null && value.length > 1) {
- Token replacement = new Token(TokenType.GT, token.charOffset);
+ Token replacement = new Token(TokenType.GT, next.charOffset);
if (identical(value, '>>')) {
- replacement.next = new Token(TokenType.GT, token.charOffset + 1);
- token = rewriter.replaceToken(token, replacement);
+ replacement.next = new Token(TokenType.GT, next.charOffset + 1);
+ token = rewriter.replaceTokenFollowing(token, replacement);
} else if (identical(value, '>=')) {
- replacement.next = new Token(TokenType.EQ, token.charOffset + 1);
- token = rewriter.replaceToken(token, replacement);
+ replacement.next = new Token(TokenType.EQ, next.charOffset + 1);
+ token = rewriter.replaceTokenFollowing(token, replacement);
} else if (identical(value, '>>=')) {
- replacement.next = new Token(TokenType.GT, token.charOffset + 1);
- replacement.next.next = new Token(TokenType.EQ, token.charOffset + 2);
- token = rewriter.replaceToken(token, replacement);
+ replacement.next = new Token(TokenType.GT, next.charOffset + 1);
+ replacement.next.next = new Token(TokenType.EQ, next.charOffset + 2);
+ token = rewriter.replaceTokenFollowing(token, replacement);
+ } else {
+ token = next;
}
+ } else {
+ token = next;
}
endStuff(count, begin, token);
@@ -2745,17 +2751,14 @@
} else {
// If there are modifiers other than or in addition to `external`
// then we need to recover.
- final context = new TopLevelMethodModifierContext(this, name);
+ final context = new TopLevelMethodModifierContext(this, beforeName);
token = context.parseRecovery(beforeToken, afterModifiers);
- // TODO(brianwilkerson): Remove the invocation of `previous` when
- // `parseRecovery` returns the last consumed token.
- beforeToken = token.previous;
+ beforeToken = token;
+ token = token.next;
beforeExternalToken = beforeToken;
externalToken = context.externalToken;
- name = context.name;
- // TODO(brianwilkerson): Remove the invocation of `previous` when
- // `context.name` returns the token before the name.
- beforeName = name.previous;
+ beforeName = context.beforeName;
+ name = beforeName.next;
// If the modifiers form a partial top level directive or declaration
// and we have found the start of a new top level declaration
@@ -3893,8 +3896,8 @@
int statementCount = 0;
if (!optional('{', next)) {
token = recoverFromMissingFunctionBody(next);
- listener.handleInvalidFunctionBody(token.next);
- return token;
+ listener.handleInvalidFunctionBody(token);
+ return token.endGroup;
}
listener.beginBlockFunctionBody(begin);
@@ -4326,9 +4329,7 @@
new BeginToken(TokenType.OPEN_SQUARE_BRACKET, next.charOffset,
next.precedingComments),
new Token(TokenType.CLOSE_SQUARE_BRACKET, next.charOffset + 1));
- // TODO(brianwilkerson): Remove the invocation of `previous` when
- // `replaceToken` returns the last consumed token.
- token = rewriter.replaceToken(next, replacement).previous;
+ rewriter.replaceTokenFollowing(token, replacement);
token = parseArgumentOrIndexStar(token, null);
} else {
token = reportUnexpectedToken(token.next);
@@ -4420,8 +4421,13 @@
}
} else if (identical(value, '+')) {
// Dart no longer allows prefix-plus.
- reportRecoverableError(token.next, fasta.messageUnsupportedPrefixPlus);
- return parseUnaryExpression(token.next, allowCascades);
+ rewriteAndRecover(
+ token,
+ // TODO(danrubel): Consider reporting "missing identifier" instead.
+ fasta.messageUnsupportedPrefixPlus,
+ new SyntheticStringToken(
+ TokenType.IDENTIFIER, '', token.next.offset));
+ return parsePrimary(token, IdentifierContext.expression);
} else if ((identical(value, '!')) ||
(identical(value, '-')) ||
(identical(value, '~'))) {
@@ -4605,7 +4611,8 @@
BeginToken begin = token;
token = parseExpression(token).next;
if (!identical(begin.endGroup, token)) {
- reportUnexpectedToken(token).next;
+ reportRecoverableError(
+ token, fasta.templateExpectedButGot.withArguments(')'));
token = begin.endGroup;
}
listener.handleParenthesizedExpression(begin);
@@ -4656,6 +4663,7 @@
/// if not. This is a suffix parser because it is assumed that type arguments
/// have been parsed, or `listener.handleNoTypeArguments` has been executed.
Token parseLiteralListSuffix(Token token, Token constKeyword) {
+ Token beforeToken = token;
Token beginToken = token = token.next;
assert(optional('[', token) || optional('[]', token));
int count = 0;
@@ -4678,7 +4686,7 @@
BeginToken replacement = link(
new BeginToken(TokenType.OPEN_SQUARE_BRACKET, token.offset),
new Token(TokenType.CLOSE_SQUARE_BRACKET, token.offset + 1));
- rewriter.replaceToken(token, replacement);
+ rewriter.replaceTokenFollowing(beforeToken, replacement);
token = replacement.next;
listener.handleLiteralList(0, replacement, constKeyword, token);
return token;
diff --git a/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart b/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart
index 172633d..758574b 100644
--- a/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart
+++ b/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart
@@ -45,13 +45,13 @@
return insertedToken;
}
- /// Replace the single [replacedToken] with the chain of tokens starting at
- /// the [replacementToken]. The [replacedToken] is assumed to be reachable
- /// from, but not the same as, the [previousToken].
- Token replaceToken(Token replacedToken, Token replacementToken) {
- Token previous = replacedToken.previous;
- previous.next = replacementToken;
- replacementToken.previous = previous;
+ /// Replace the single token immediately following the [previousToken] with
+ /// the chain of tokens starting at the [replacementToken]. Return the
+ /// [replacementToken].
+ Token replaceTokenFollowing(Token previousToken, Token replacementToken) {
+ Token replacedToken = previousToken.next;
+ previousToken.next = replacementToken;
+ replacementToken.previous = previousToken;
(replacementToken as SimpleToken).precedingComments =
replacedToken.precedingComments;
diff --git a/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart b/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
index 3f38464..623aa63 100644
--- a/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
+++ b/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
@@ -48,6 +48,9 @@
/// file offset.
final _testedFeaturesState = <Uri, Map<int, Set<String>>>{};
+ /// Map from file URI to a sorted list of token offsets for that file.
+ final _tokenOffsets = <Uri, List<int>>{};
+
/// String descriptions of the expectation mismatches found so far.
final _problems = <String>[];
@@ -119,8 +122,10 @@
var bytes = await readBytesFromFile(uri);
var expectations = _unsatisfiedExpectations.putIfAbsent(uri, () => {});
var testedFeaturesState = _testedFeaturesState.putIfAbsent(uri, () => {});
+ var tokenOffsets = _tokenOffsets.putIfAbsent(uri, () => []);
ScannerResult result = scan(bytes, includeComments: true);
for (Token token = result.tokens; !token.isEof; token = token.next) {
+ tokenOffsets.add(token.offset);
for (analyzer.Token commentToken = token.precedingComments;
commentToken != null;
commentToken = commentToken.next) {
@@ -171,6 +176,7 @@
}
var expectationsForUri = _unsatisfiedExpectations[uri];
if (expectationsForUri == null) return;
+ offset = _normalizeOffset(offset, _tokenOffsets[uri]);
var expectationsAtOffset = expectationsForUri[offset];
if (expectationsAtOffset != null) {
for (int i = 0; i < expectationsAtOffset.length; i++) {
@@ -221,6 +227,36 @@
return '/*@$property=${_escape(value.toString())}*/';
}
+ /// If [offset] is not one of the token offsets in [tokenOffsets], increase it
+ /// until it is.
+ ///
+ /// Exception: if [offset] is past the last token offset in [tokenOffsets],
+ /// leave it alone.
+ int _normalizeOffset(int offset, List<int> tokenOffsets) {
+ int i = -1;
+ int j = tokenOffsets.length;
+ // Invariant: (i == -1 || tokenOffsets[i] < offset) &&
+ // (j == tokenOffsets.length || offset <= tokenOffsets[j])
+ while (j - i > 1) {
+ int k = (i + j) ~/ 2;
+ if (tokenOffsets[k] < offset) {
+ i = k;
+ } else {
+ j = k;
+ }
+ }
+ // Now i == j - 1
+ if (j < tokenOffsets.length) {
+ // tokenOffsets[j-1] < offset <= tokenOffsets[j]
+ // Therefore the comment belongs with token j.
+ return tokenOffsets[j];
+ } else {
+ // j-1 is the last token, and tokenOffsets[j-1] < offset. Since there's
+ // no later token, we can't normalize the offset.
+ return offset;
+ }
+ }
+
void _problem(Uri uri, int offset, String desc, _Fix fix) {
_problems.add(_formatProblem(uri, offset, desc, null));
_fixes.putIfAbsent(uri, () => []).add(fix);
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart
index d77713c..720f0c0 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart
@@ -200,10 +200,12 @@
void fieldInitializerExit(FieldInitializer initializer) =>
genericInitializerExit("fieldInitializer", initializer);
- void forInStatementEnter(ForInStatement statement) =>
+ void forInStatementEnter(ForInStatement statement,
+ VariableDeclaration variable, Expression write) =>
genericStatementEnter('forInStatement', statement);
- void forInStatementExit(ForInStatement statement) =>
+ void forInStatementExit(
+ ForInStatement statement, VariableDeclaration variable) =>
genericStatementExit('forInStatement', statement);
void forStatementEnter(ForStatement statement) =>
@@ -226,6 +228,8 @@
FunctionExpression expression, DartType inferredType) =>
genericExpressionExit("functionExpression", expression, inferredType);
+ void ifNullBeforeRhs(Expression expression) {}
+
bool ifNullEnter(Expression expression, DartType typeContext) =>
genericExpressionEnter('ifNull', expression, typeContext);
@@ -268,7 +272,8 @@
bool isNotExpressionEnter(Not expression, DartType typeContext) =>
genericExpressionEnter("isNotExpression", expression, typeContext);
- void isNotExpressionExit(Not expression, DartType inferredType) =>
+ void isNotExpressionExit(
+ Not expression, DartType type, DartType inferredType) =>
genericExpressionExit("isNotExpression", expression, inferredType);
void labeledStatementEnter(LabeledStatement statement) =>
@@ -283,6 +288,8 @@
void listLiteralExit(ListLiteral expression, DartType inferredType) =>
genericExpressionExit("listLiteral", expression, inferredType);
+ void logicalExpressionBeforeRhs(LogicalExpression expression) {}
+
bool logicalExpressionEnter(
LogicalExpression expression, DartType typeContext) =>
genericExpressionEnter("logicalExpression", expression, typeContext);
@@ -389,10 +396,17 @@
void returnStatementExit(ReturnStatement statement) =>
genericStatementExit('returnStatement', statement);
- bool staticAssignEnter(Expression expression, DartType typeContext) =>
+ bool staticAssignEnter(
+ Expression expression, Expression write, DartType typeContext) =>
genericExpressionEnter("staticAssign", expression, typeContext);
- void staticAssignExit(Expression expression, DartType inferredType) =>
+ void staticAssignExit(
+ Expression expression,
+ Expression write,
+ Member writeMember,
+ DartType writeContext,
+ Procedure combiner,
+ DartType inferredType) =>
genericExpressionExit("staticAssign", expression, inferredType);
bool staticGetEnter(StaticGet expression, DartType typeContext) =>
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 23e4d98..581894d 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -33,6 +33,7 @@
Initializer,
InterfaceType,
InvocationExpression,
+ Let,
ListLiteral,
Member,
MethodInvocation,
@@ -429,7 +430,11 @@
/// For the special case where [receiverType] is a [FunctionType], and the
/// method name is `call`, the string `call` is returned as a sentinel object.
Object findInterfaceMember(DartType receiverType, Name name, int fileOffset,
- {bool setter: false, bool silent: false}) {
+ {Template<Message Function(String, DartType)> errorTemplate,
+ Expression expression,
+ Expression receiver,
+ bool setter: false,
+ bool silent: false}) {
// Our non-strong golden files currently don't include interface
// targets, so we can't store the interface target without causing tests
// to fail. TODO(paulberry): fix this.
@@ -450,6 +455,22 @@
instrumentation?.record(uri, fileOffset, 'target',
new InstrumentationValueForMember(interfaceMember));
}
+ if (!isTopLevel &&
+ interfaceMember == null &&
+ receiverType is! DynamicType &&
+ !(receiverType == coreTypes.functionClass.rawType &&
+ name.name == 'call') &&
+ errorTemplate != null) {
+ expression.parent.replaceChild(
+ expression,
+ new Let(
+ new VariableDeclaration.forValue(receiver)
+ ..fileOffset = receiver.fileOffset,
+ helper.buildCompileTimeError(
+ errorTemplate.withArguments(name.name, receiverType),
+ fileOffset))
+ ..fileOffset = fileOffset);
+ }
return interfaceMember;
}
@@ -463,6 +484,9 @@
if (methodInvocation is MethodInvocation) {
var interfaceMember = findInterfaceMember(
receiverType, methodInvocation.name, methodInvocation.fileOffset,
+ errorTemplate: templateUndefinedMethod,
+ expression: methodInvocation,
+ receiver: methodInvocation.receiver,
silent: silent);
if (strongMode && interfaceMember is Member) {
methodInvocation.interfaceTarget = interfaceMember;
@@ -491,6 +515,9 @@
if (propertyGet is PropertyGet) {
var interfaceMember = findInterfaceMember(
receiverType, propertyGet.name, propertyGet.fileOffset,
+ errorTemplate: templateUndefinedGetter,
+ expression: propertyGet,
+ receiver: propertyGet.receiver,
silent: silent);
if (strongMode && interfaceMember is Member) {
propertyGet.interfaceTarget = interfaceMember;
@@ -517,7 +544,11 @@
if (propertySet is PropertySet) {
var interfaceMember = findInterfaceMember(
receiverType, propertySet.name, propertySet.fileOffset,
- setter: true, silent: silent);
+ errorTemplate: templateUndefinedSetter,
+ expression: propertySet,
+ receiver: propertySet.receiver,
+ setter: true,
+ silent: silent);
if (strongMode && interfaceMember is Member) {
propertySet.interfaceTarget = interfaceMember;
}
@@ -1170,8 +1201,11 @@
}
propertyName ??= desugaredGet.name;
if (desugaredGet != null) {
- interfaceMember =
- findInterfaceMember(receiverType, propertyName, fileOffset);
+ interfaceMember = findInterfaceMember(
+ receiverType, propertyName, fileOffset,
+ errorTemplate: templateUndefinedGetter,
+ expression: expression,
+ receiver: desugaredGet.receiver);
if (interfaceMember is Member) {
desugaredGet.interfaceTarget = interfaceMember;
}
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart
index a5bb0eb..8c1f522 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart
@@ -85,7 +85,8 @@
newReturnType ?? node.returnType,
namedParameters: newNamedParameters ?? node.namedParameters,
typeParameters: node.typeParameters,
- requiredParameterCount: node.requiredParameterCount);
+ requiredParameterCount: node.requiredParameterCount,
+ typedefReference: node.typedefReference);
}
}
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
index 83ec722..26cba01 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
@@ -27,7 +27,8 @@
named.name, substitution.substituteType(named.type)))
.toList(),
typeParameters: newTypeParameters,
- requiredParameterCount: type.requiredParameterCount);
+ requiredParameterCount: type.requiredParameterCount,
+ typedefReference: type.typedefReference);
}
/// Given a [FunctionType], gets the type of the named parameter with the given
diff --git a/pkg/front_end/lib/src/incremental/kernel_driver.dart b/pkg/front_end/lib/src/incremental/kernel_driver.dart
index 8ee0578..f489459 100644
--- a/pkg/front_end/lib/src/incremental/kernel_driver.dart
+++ b/pkg/front_end/lib/src/incremental/kernel_driver.dart
@@ -375,11 +375,11 @@
}
// Prepare file URIs for the cycle.
- var cycleFileUris = new Set<String>();
+ var cycleFileUris = new Set<Uri>();
for (FileState library in cycle.libraries) {
- cycleFileUris.add(library.fileUriStr);
+ cycleFileUris.add(library.fileUri);
for (var partFile in library.partFiles) {
- cycleFileUris.add(partFile.fileUriStr);
+ cycleFileUris.add(partFile.fileUri);
}
}
@@ -429,10 +429,10 @@
// Remove source for libraries outside of the cycle.
{
- var urisToRemoveSources = <String>[];
+ var urisToRemoveSources = <Uri>[];
for (var uri in program.uriToSource.keys) {
- if (!cycleFileUris.contains("$uri")) {
- urisToRemoveSources.add("$uri");
+ if (!cycleFileUris.contains(uri)) {
+ urisToRemoveSources.add(uri);
}
}
urisToRemoveSources.forEach(program.uriToSource.remove);
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index 56a2e75..db982ad 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -603,6 +603,7 @@
RequiredParameterWithDefault:
template: "Non-optional parameters can't have a default value."
tip: "Try removing the default value or making the parameter optional."
+ analyzerCode: NAMED_PARAMETER_OUTSIDE_GROUP
dart2jsCode: REQUIRED_PARAMETER_WITH_DEFAULT
script:
- >
@@ -660,6 +661,7 @@
UnsupportedPrefixPlus:
template: "'+' is not a prefix operator."
tip: "Try removing '+'."
+ analyzerCode: MISSING_IDENTIFIER
dart2jsCode: UNSUPPORTED_PREFIX_PLUS
script: "main() => +2; // No longer a valid way to write '2'"
@@ -1566,3 +1568,38 @@
template: "Can't apply this patch as its origin declaration isn't external."
tip: "Try adding 'external' to the origin declaration."
+UndefinedGetter:
+ template: "The getter '#name' isn't defined for the class '#type'."
+ tip: "Try correcting the name to the name of an existing getter, or defining a getter or field named '#name'."
+ analyzerCode: UNDEFINED_GETTER
+ dart2jsCode: "*ignored*"
+ script: >
+ class C {}
+ main() {
+ C c;
+ print(c.foo);
+ }
+
+UndefinedSetter:
+ template: "The setter '#name' isn't defined for the class '#type'."
+ tip: "Try correcting the name to the name of an existing setter, or defining a setter or field named '#name'."
+ analyzerCode: UNDEFINED_SETTER
+ dart2jsCode: "*ignored*"
+ script: >
+ class C {}
+ main() {
+ C c;
+ c.foo = 0;
+ }
+
+UndefinedMethod:
+ template: "The method '#name' isn't defined for the class '#type'."
+ tip: "Try correcting the name to the name of an existing method, or defining a method named '#name'."
+ analyzerCode: UNDEFINED_METHOD
+ dart2jsCode: "*ignored*"
+ script: >
+ class C {}
+ main() {
+ C c;
+ c.foo();
+ }
diff --git a/pkg/front_end/test/fasta/parser/token_stream_rewriter_test.dart b/pkg/front_end/test/fasta/parser/token_stream_rewriter_test.dart
index 63f7c4e..6be8843 100644
--- a/pkg/front_end/test/fasta/parser/token_stream_rewriter_test.dart
+++ b/pkg/front_end/test/fasta/parser/token_stream_rewriter_test.dart
@@ -60,7 +60,7 @@
expect(b.next, same(c));
}
- void test_replaceToken_multiple() {
+ void test_replaceTokenFollowing_multiple() {
var a = _makeToken(0, 'a');
var b = _makeToken(1, 'b');
var c = _makeToken(2, 'c');
@@ -70,21 +70,21 @@
_link([a, b, e, f]);
_link([c, d]);
var rewriter = new TokenStreamRewriter();
- rewriter.replaceToken(e, c);
+ rewriter.replaceTokenFollowing(b, c);
expect(a.next, same(b));
expect(b.next, same(c));
expect(c.next, same(d));
expect(d.next, same(f));
}
- void test_replaceToken_single() {
+ void test_replaceTokenFollowing_single() {
var a = _makeToken(0, 'a');
var b = _makeToken(1, 'b');
var c = _makeToken(2, 'c');
var d = _makeToken(3, 'd');
_link([a, b, d]);
var rewriter = new TokenStreamRewriter();
- rewriter.replaceToken(b, c);
+ rewriter.replaceTokenFollowing(a, c);
expect(a.next, same(c));
expect(c.next, same(d));
}
@@ -187,18 +187,6 @@
@override
@failingTest
- void test_replaceToken_multiple() {
- super.test_replaceToken_multiple();
- }
-
- @override
- @failingTest
- void test_replaceToken_single() {
- super.test_replaceToken_single();
- }
-
- @override
- @failingTest
void test_second_insertion_earlier_in_stream() {
super.test_second_insertion_earlier_in_stream();
}
diff --git a/pkg/front_end/test/fasta/testing/analyzer_diet_listener.dart b/pkg/front_end/test/fasta/testing/analyzer_diet_listener.dart
index af3fd2c..022afce 100644
--- a/pkg/front_end/test/fasta/testing/analyzer_diet_listener.dart
+++ b/pkg/front_end/test/fasta/testing/analyzer_diet_listener.dart
@@ -19,7 +19,7 @@
import 'package:analyzer/src/fasta/ast_builder.dart' show AstBuilder;
import 'package:analyzer/src/fasta/resolution_applier.dart'
- show TypeContext, ValidatingResolutionApplier;
+ show ResolutionApplier, TypeContext;
import 'package:analyzer/src/fasta/resolution_storer.dart'
show InstrumentedResolutionStorer;
@@ -184,13 +184,13 @@
// Now apply the resolution data and inferred types to the analyzer AST.
var translatedDeclarations = _translateDeclarations(_kernelDeclarations);
var translatedReferences = _translateReferences(_kernelReferences);
- var resolutionApplier = new ValidatingResolutionApplier(
+ var resolutionApplier = new ResolutionApplier(
new _TestTypeContext(),
translatedDeclarations,
- translatedReferences,
- _kernelTypes,
_declarationOffsets,
+ translatedReferences,
_referenceOffsets,
+ _kernelTypes,
_typeOffsets);
ast.AstNode fields = listener.finishFields();
fields.accept(resolutionApplier);
@@ -242,13 +242,13 @@
// Now apply the resolution data and inferred types to the analyzer AST.
var translatedDeclarations = _translateDeclarations(_kernelDeclarations);
var translatedReferences = _translateReferences(_kernelReferences);
- var resolutionApplier = new ValidatingResolutionApplier(
+ var resolutionApplier = new ResolutionApplier(
new _TestTypeContext(),
translatedDeclarations,
- translatedReferences,
- _kernelTypes,
_declarationOffsets,
+ translatedReferences,
_referenceOffsets,
+ _kernelTypes,
_typeOffsets);
ast.AstNode bodyAsAstNode = body;
bodyAsAstNode.accept(resolutionApplier);
@@ -317,6 +317,9 @@
ast.ClassElement get enclosingClassElement => null;
@override
+ ast.DartType get stringType => null;
+
+ @override
ast.DartType get typeType => null;
@override
diff --git a/pkg/front_end/test/subpackage_relationships_test.dart b/pkg/front_end/test/subpackage_relationships_test.dart
index 529da68..9ddcf3f 100644
--- a/pkg/front_end/test/subpackage_relationships_test.dart
+++ b/pkg/front_end/test/subpackage_relationships_test.dart
@@ -55,10 +55,10 @@
'lib/src',
'lib/src/api_prototype',
'lib/src/base',
+ 'lib/src/fasta',
'lib/src/fasta/scanner',
]),
'lib/src/base': new SubpackageRules(allowedDependencies: [
- 'lib/src',
'lib/src/api_prototype',
'lib/src/fasta',
'lib/src/fasta/util',
diff --git a/pkg/front_end/test/summary_generator_test.dart b/pkg/front_end/test/summary_generator_test.dart
index 92131af..052e616 100644
--- a/pkg/front_end/test/summary_generator_test.dart
+++ b/pkg/front_end/test/summary_generator_test.dart
@@ -111,27 +111,6 @@
expect(errors, isEmpty);
});
- test('summarization with multi-roots can work hermetically', () async {
- var errors = [];
- var options = new CompilerOptions()
- ..onError = ((e) => errors.add(e))
- ..multiRoots = [toTestUri('rootA/'), toTestUri('rootB/')];
-
- var multiRootSources = <String, String>{
- 'rootA/a.dart': allSources['a.dart'],
- 'rootB/b.dart': allSources['b.dart'],
- };
-
- await summarize(['multi-root:/b.dart'], multiRootSources, options: options);
- expect(errors.first.toString(), contains('Invalid access'));
- errors.clear();
-
- await summarize(
- ['multi-root:/a.dart', 'multi-root:/b.dart'], multiRootSources,
- options: options);
- expect(errors, isEmpty);
- });
-
// TODO(sigmund): test trimDependencies when it is part of the public API.
}
diff --git a/pkg/front_end/testcases/ast_builder.status b/pkg/front_end/testcases/ast_builder.status
index f27e0c3..df13a6c 100644
--- a/pkg/front_end/testcases/ast_builder.status
+++ b/pkg/front_end/testcases/ast_builder.status
@@ -14,14 +14,9 @@
classes: Crash
default_values: Crash
duplicated_named_args_3: Crash
-escape: Crash
expressions: Crash
-external: Crash
-fallthrough: Crash
-for_in_scope: Crash
function_type_is_check: Crash
function_type_recovery: Crash
-functions: Crash
illegal_named_function_expression: Crash
illegal_named_function_expression_scope: Crash
implicit_scope_test: Crash
@@ -29,13 +24,9 @@
inference/assert_initializer: Crash
inference/block_bodied_lambdas_async_star: Crash
inference/bug30251: Crash
-inference/bug30620: Crash
-inference/bug30620_b: Crash
-inference/bug30620_c: Crash
inference/bug30624: Crash
inference/bug31133: Crash
inference/call_corner_cases: Crash
-inference/complex_predecrement: Crash
inference/constructors_infer_from_arguments: Crash
inference/constructors_infer_from_arguments_redirecting: Crash
inference/constructors_too_many_positional_arguments: Crash
@@ -68,7 +59,6 @@
inference/field_initializer_context_this: Crash
inference/field_initializer_parameter: Crash
inference/for_each_downcast_iterable: Crash
-inference/for_in_loop_promotion: Crash
inference/for_loop_initializer_expression: Crash
inference/future_then: Crash
inference/future_then_2: Crash
@@ -103,9 +93,7 @@
inference/generic_methods_iterable_and_future: Crash
inference/generic_methods_nested_generic_instantiation: Crash
inference/greatest_closure_multiple_params: Crash
-inference/infer_assign_to_index_full: Crash
inference/infer_assign_to_static: Crash
-inference/infer_assign_to_static_upwards: Crash
inference/infer_correctly_on_multiple_variables_declared_together: Crash
inference/infer_from_complex_expressions_if_outer_most_value_is_precise: Crash
inference/infer_from_variables_in_cycle_libs_when_flag_is_on2: Crash
@@ -113,7 +101,6 @@
inference/infer_from_variables_in_cycle_libs_when_flag_is_on: Crash
inference/infer_from_variables_in_cycle_libs_when_flag_is_on_a: Crash
inference/infer_from_variables_in_non_cycle_imports_with_flag2: Crash
-inference/infer_from_variables_in_non_cycle_imports_with_flag: Crash
inference/infer_generic_method_type_named: Crash
inference/infer_generic_method_type_positional2: Crash
inference/infer_generic_method_type_positional: Crash
@@ -132,8 +119,6 @@
inference/infer_types_on_loop_indices_for_each_loop_async: Crash
inference/inferred_initializing_formal_checks_default_value: Crash
inference/inferred_type_cascade: Crash
-inference/inferred_type_custom_index_op: Crash
-inference/inferred_type_custom_index_op_via_interface: Crash
inference/inferred_type_is_enum: Crash
inference/inferred_type_is_enum_values: Crash
inference/inferred_type_is_typedef: Crash
@@ -141,18 +126,10 @@
inference/inferred_type_uses_synthetic_function_type_named_param: Crash
inference/inferred_type_uses_synthetic_function_type_positional_param: Crash
inference/lambda_does_not_have_propagated_type_hint: Crash
-inference/map_literals: Crash
-inference/map_literals_can_infer_null: Crash
-inference/map_literals_top_level: Crash
inference/method_call_with_type_arguments_static_method: Crash
-inference/null_coalescing_operator: Crash
-inference/null_coalescing_operator_2: Crash
-inference/null_literal_should_not_infer_as_bottom: Crash
inference/parameter_defaults_downwards: Crash
inference/parameter_defaults_upwards: Crash
-inference/promote_from_logical_rhs: Crash
inference/static_method_tear_off: Crash
-inference/string_literal: Crash
inference/super_initializer: Crash
inference/super_initializer_substitution: Crash
inference/switch_continue: Crash
@@ -160,7 +137,6 @@
inference/try_catch: Crash
inference/try_catch_finally: Crash
inference/try_catch_promotion: Crash
-inference/type_promotion_not_and_not: Crash
inference/unsafe_block_closure_inference_closure_call: Crash
inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1: Crash
inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2: Crash
@@ -172,27 +148,15 @@
inference/unsafe_block_closure_inference_in_map_typed: Crash
inference_new/for_each_invalid_iterable: Crash
inference_new/for_each_outer_var_type: Crash
-inference_new/indexed_assign_combiner: Crash
-inference_new/infer_assign_to_index: Crash
-inference_new/infer_assign_to_index_full: Crash
-inference_new/infer_assign_to_index_set_vs_get: Crash
-inference_new/infer_assign_to_index_upwards: Crash
-inference_new/infer_assign_to_ref: Crash
inference_new/infer_assign_to_static: Crash
-inference_new/infer_assign_to_static_upwards: Crash
-inference_new/infer_logical: Crash
-inference_new/invalid_assignment_during_toplevel_inference: Crash
-inference_new/static_assign_combiner: Crash
inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2: Crash
inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2: Crash
invocations: Crash
-local_generic_function: Crash
metadata_enum: Crash
metadata_named_mixin_application: Crash
micro: Crash
named_parameters: Crash
null_aware: Crash
-operators: Crash
optional: Crash
qualified: Crash
rasta/abstract_constructor: Crash
@@ -208,7 +172,6 @@
rasta/issue_000001: Crash
rasta/issue_000002: Crash
rasta/issue_000004: Crash
-rasta/issue_000025: Crash
rasta/issue_000031: Crash
rasta/issue_000036: Crash
rasta/issue_000039: VerificationError
@@ -219,8 +182,6 @@
rasta/issue_000068: Crash
rasta/issue_000069: Crash
rasta/issue_000070: Crash
-rasta/issue_000081: Crash
-rasta/malformed_const_constructor: Crash
rasta/malformed_function: Crash
rasta/mandatory_parameter_initializer: VerificationError
rasta/mixin_library: Crash
@@ -269,8 +230,6 @@
runtime_checks/implicit_downcast_while: Crash
runtime_checks_new/contravariant_combiner: Crash
runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast: Crash
-runtime_checks_new/contravariant_index_assign: Crash
-runtime_checks_new/contravariant_index_get: Crash
runtime_checks_new/derived_class_typed: Crash
runtime_checks_new/implicit_downcast_field: Crash
runtime_checks_new/mixin_forwarding_stub_field: Crash
@@ -278,10 +237,7 @@
runtime_checks_new/mixin_forwarding_stub_setter: Crash
runtime_checks_new/stub_checked_via_target: Crash
statements: Crash
-static_setter: Crash
super_rasta_copy: Crash
-top_level_accessors: Crash
type_variable_as_super: Crash
type_variable_prefix: Crash
uninitialized_fields: Crash
-void_methods: Crash
diff --git a/pkg/front_end/testcases/bug21938.dart b/pkg/front_end/testcases/bug21938.dart
new file mode 100644
index 0000000..c8555af
--- /dev/null
+++ b/pkg/front_end/testcases/bug21938.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/*@testedFeatures=error*/
+
+test() {
+ Object x;
+ Function f;
+ x /*@error=UndefinedMethod*/ ();
+ x /*@error=UndefinedMethod*/ (3);
+ f(5, 2);
+ x. /*@error=UndefinedMethod*/ call();
+ f.call;
+ f.call(5, 2);
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/bug21938.dart.direct.expect b/pkg/front_end/testcases/bug21938.dart.direct.expect
new file mode 100644
index 0000000..a399b1b
--- /dev/null
+++ b/pkg/front_end/testcases/bug21938.dart.direct.expect
@@ -0,0 +1,15 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method test() → dynamic {
+ core::Object x;
+ core::Function f;
+ x.call();
+ x.call(3);
+ f.call(5, 2);
+ x.call();
+ f.call;
+ f.call(5, 2);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/bug21938.dart.outline.expect b/pkg/front_end/testcases/bug21938.dart.outline.expect
new file mode 100644
index 0000000..a29647d
--- /dev/null
+++ b/pkg/front_end/testcases/bug21938.dart.outline.expect
@@ -0,0 +1,7 @@
+library;
+import self as self;
+
+static method test() → dynamic
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/bug21938.dart.strong.expect b/pkg/front_end/testcases/bug21938.dart.strong.expect
new file mode 100644
index 0000000..5a5cd3c
--- /dev/null
+++ b/pkg/front_end/testcases/bug21938.dart.strong.expect
@@ -0,0 +1,15 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method test() → dynamic {
+ core::Object x;
+ core::Function f;
+ let final dynamic #t1 = x in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/bug21938.dart:10:4: Error: The method 'call' isn't defined for the class 'dart.core::Object'.\nTry correcting the name to the name of an existing method, or defining a method named 'call'.\n x /*@error=UndefinedMethod*/ ();\n ^"));
+ let final dynamic #t2 = x in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/bug21938.dart:11:4: Error: The method 'call' isn't defined for the class 'dart.core::Object'.\nTry correcting the name to the name of an existing method, or defining a method named 'call'.\n x /*@error=UndefinedMethod*/ (3);\n ^"));
+ f.call(5, 2);
+ let final dynamic #t3 = x in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/bug21938.dart:13:33: Error: The method 'call' isn't defined for the class 'dart.core::Object'.\nTry correcting the name to the name of an existing method, or defining a method named 'call'.\n x. /*@error=UndefinedMethod*/ call();\n ^"));
+ f.call;
+ f.call(5, 2);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart
index 0323c48..ec23762 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart
@@ -7,7 +7,7 @@
typedef T Function2<S, T>(S x);
-void main() {
+void test() {
{
Function2<int, String> l0 = /*@returnType=String*/ (int x) => null;
Function2<int, String> l1 = /*@returnType=String*/ (int x) => "hello";
@@ -68,3 +68,5 @@
x. /*@target=String::substring*/ substring(3);
}
}
+
+main() {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.expect
index 2213fe9..12eb980 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
-static method main() → void {
+static method test() → void {
{
(core::int) → core::String l0 = (core::int x) → dynamic => null;
(core::int) → core::String l1 = (core::int x) → dynamic => "hello";
@@ -41,3 +41,4 @@
(core::String) → core::String l4 = (dynamic x) → dynamic => x.substring(3);
}
}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.expect
index a30965f..aaba521 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
-static method main() → void {
+static method test() → void {
{
(core::int) → core::String l0 = (core::int x) → core::String => null;
(core::int) → core::String l1 = (core::int x) → core::String => "hello";
@@ -37,7 +37,8 @@
(core::int) → core::int l0 = (core::int x) → core::int => x;
(core::int) → core::int l1 = (core::int x) → core::int => x.{core::num::+}(1);
(core::int) → core::String l2 = let final dynamic #t10 = (core::int x) → core::int => x in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:61:63: Error: A value of type '(dart.core::int) \u8594 dart.core::int' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to '(dart.core::int) \u8594 dart.core::String'.\n l2 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=int*/ (/*@type=int*/ x) =>\n ^"));
- (core::int) → core::String l3 = (core::int x) → core::String => x.substring(3);
+ (core::int) → core::String l3 = (core::int x) → core::String => let final dynamic #t11 = x in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:65:14: Error: The method 'substring' isn't defined for the class 'dart.core::int'.\nTry correcting the name to the name of an existing method, or defining a method named 'substring'.\n .substring(3);\n ^"));
(core::String) → core::String l4 = (core::String x) → core::String => x.{core::String::substring}(3);
}
}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.expect
index feeb43f..73f816f 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.expect
@@ -53,7 +53,7 @@
x = <T extends core::Object>(core::int x) → core::int => x.{core::num::+}(1);
<T extends core::Object>(core::int) → core::String y = int2String;
y = let final dynamic #t10 = <T extends core::Object>(core::int x) → core::int => x in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:63:36: Error: A value of type '<T extends dart.core::Object>(dart.core::int) \u8594 dart.core::int' can't be assigned to a variable of type '<T extends dart.core::Object>(dart.core::int) \u8594 dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to '<T extends dart.core::Object>(dart.core::int) \u8594 dart.core::String'.\n T> /*@returnType=int*/ (/*@type=int*/ x) =>\n ^"));
- y = <T extends core::Object>(core::int x) → core::String => x.substring(3);
+ y = <T extends core::Object>(core::int x) → core::String => let final dynamic #t11 = x in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:66:10: Error: The method 'substring' isn't defined for the class 'dart.core::int'.\nTry correcting the name to the name of an existing method, or defining a method named 'substring'.\n .substring(3);\n ^"));
<T extends core::Object>(core::String) → core::String z = string2String;
z = <T extends core::Object>(core::String x) → core::String => x.{core::String::substring}(3);
}
diff --git a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart
index 82db05f..ab84ffd 100644
--- a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart
+++ b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart
@@ -10,7 +10,7 @@
Future<int> make(int x) => (new /*@typeArgs=int*/ Future(
/*@returnType=int*/ () => x));
-main() {
+test() {
Iterable<Future<int>> list = <int>[1, 2, 3]
. /*@typeArgs=Future<int>*/ /*@target=Iterable::map*/ map(make);
Future<List<int>> results = Future. /*@typeArgs=int*/ wait(list);
@@ -44,3 +44,5 @@
x /*@target=String::+*/ +
y. /*@target=int::toString*/ toString()));
}
+
+main() {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.direct.expect
index d48ab2c..cda283f 100644
--- a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.direct.expect
@@ -5,10 +5,11 @@
static method make(core::int x) → asy::Future<core::int>
return asy::Future::•<dynamic>(() → dynamic => x);
-static method main() → dynamic {
+static method test() → dynamic {
core::Iterable<asy::Future<core::int>> list = <core::int>[1, 2, 3].map(self::make);
asy::Future<core::List<core::int>> results = asy::Future::wait<dynamic>(list);
asy::Future<core::String> results2 = results.then((core::List<core::int> list) → dynamic => list.fold("", (dynamic x, dynamic y) → dynamic => x.+(y.toString())));
asy::Future<core::String> results3 = results.then((core::List<core::int> list) → dynamic => list.fold("", (core::String x, dynamic y) → dynamic => x.+(y.toString())));
asy::Future<core::String> results4 = results.then((core::List<core::int> list) → dynamic => list.fold<core::String>("", (dynamic x, dynamic y) → dynamic => x.+(y.toString())));
}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect
index 3b152f3..954645b 100644
--- a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect
@@ -5,10 +5,11 @@
static method make(core::int x) → asy::Future<core::int>
return asy::Future::•<core::int>(() → core::int => x);
-static method main() → dynamic {
+static method test() → dynamic {
core::Iterable<asy::Future<core::int>> list = <core::int>[1, 2, 3].{core::Iterable::map}<asy::Future<core::int>>(self::make);
asy::Future<core::List<core::int>> results = asy::Future::wait<core::int>(list);
- asy::Future<core::String> results2 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", (asy::FutureOr<core::String> x, core::int y) → asy::FutureOr<core::String> => x.+(y.{core::int::toString}())));
- asy::Future<core::String> results3 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", let final dynamic #t1 = (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}()) in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: A value of type '(dart.core::String, dart.core::int) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.\nTry changing the type of the left hand side, or casting the right hand side to '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.\n /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@returnType=String*/ (String\n ^"))));
+ asy::Future<core::String> results2 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", (asy::FutureOr<core::String> x, core::int y) → asy::FutureOr<core::String> => let final dynamic #t1 = x in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:120: Error: The method '+' isn't defined for the class 'dart.async::FutureOr<dart.core::String>'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n /*@type=int*/ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +\n ^"))));
+ asy::Future<core::String> results3 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", let final dynamic #t2 = (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}()) in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: A value of type '(dart.core::String, dart.core::int) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.\nTry changing the type of the left hand side, or casting the right hand side to '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.\n /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@returnType=String*/ (String\n ^"))));
asy::Future<core::String> results4 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → core::String => list.{core::Iterable::fold}<core::String>("", (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}())));
}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.expect b/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.expect
index a7dfd05..690683f 100644
--- a/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.expect
@@ -24,30 +24,30 @@
static field core::int f = 2.{core::num::+}(3);
static field core::int g = 3.{core::int::unary-}();
static field self::B h = new self::A::•().{self::A::+}(3);
-static field dynamic i = new self::A::•().unary-();
+static field dynamic i = let final dynamic #t3 = new self::A::•() in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:34:79: Error: The method 'unary-' isn't defined for the class 'test::A'.\nTry correcting the name to the name of an existing method, or defining a method named 'unary-'.\nvar /*@topType=dynamic*/ i = /*error:UNDEFINED_OPERATOR,info:DYNAMIC_INVOKE*/ -new A();\n ^"));
static field self::B j = null as self::B;
static method test1() → dynamic {
- self::a = let final dynamic #t3 = "hi" in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:38:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::A'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::A'.\n a = /*error:INVALID_ASSIGNMENT*/ \"hi\";\n ^"));
+ self::a = let final dynamic #t4 = "hi" in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:38:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::A'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::A'.\n a = /*error:INVALID_ASSIGNMENT*/ \"hi\";\n ^"));
self::a = new self::B::•(3);
- self::b = let final dynamic #t4 = "hi" in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:40:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::B'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::B'.\n b = /*error:INVALID_ASSIGNMENT*/ \"hi\";\n ^"));
+ self::b = let final dynamic #t5 = "hi" in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:40:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::B'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::B'.\n b = /*error:INVALID_ASSIGNMENT*/ \"hi\";\n ^"));
self::b = new self::B::•(3);
self::c1 = <dynamic>[];
- self::c1 = let final dynamic #t5 = <dynamic, dynamic>{} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:43:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dynamic>'.\n c1 = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};\n ^"));
+ self::c1 = let final dynamic #t6 = <dynamic, dynamic>{} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:43:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dynamic>'.\n c1 = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};\n ^"));
self::c2 = <dynamic>[];
- self::c2 = let final dynamic #t6 = <dynamic, dynamic>{} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:45:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dynamic>'.\n c2 = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};\n ^"));
+ self::c2 = let final dynamic #t7 = <dynamic, dynamic>{} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:45:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dynamic>'.\n c2 = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};\n ^"));
self::d = <dynamic, dynamic>{};
- self::d = let final dynamic #t7 = 3 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:47:36: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Map<dynamic, dynamic>'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::Map<dynamic, dynamic>'.\n d = /*error:INVALID_ASSIGNMENT*/ 3;\n ^"));
+ self::d = let final dynamic #t8 = 3 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:47:36: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Map<dynamic, dynamic>'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::Map<dynamic, dynamic>'.\n d = /*error:INVALID_ASSIGNMENT*/ 3;\n ^"));
self::e = new self::A::•();
- self::e = let final dynamic #t8 = <dynamic, dynamic>{} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:49:67: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'test::A'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::A'.\n e = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};\n ^"));
+ self::e = let final dynamic #t9 = <dynamic, dynamic>{} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:49:67: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'test::A'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::A'.\n e = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};\n ^"));
self::f = 3;
- self::f = let final dynamic #t9 = false in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:51:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.\n f = /*error:INVALID_ASSIGNMENT*/ false;\n ^"));
+ self::f = let final dynamic #t10 = false in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:51:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.\n f = /*error:INVALID_ASSIGNMENT*/ false;\n ^"));
self::g = 1;
- self::g = let final dynamic #t10 = false in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:53:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.\n g = /*error:INVALID_ASSIGNMENT*/ false;\n ^"));
- self::h = let final dynamic #t11 = false in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:54:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::B'.\n h = /*error:INVALID_ASSIGNMENT*/ false;\n ^"));
+ self::g = let final dynamic #t11 = false in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:53:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.\n g = /*error:INVALID_ASSIGNMENT*/ false;\n ^"));
+ self::h = let final dynamic #t12 = false in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:54:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::B'.\n h = /*error:INVALID_ASSIGNMENT*/ false;\n ^"));
self::h = new self::B::•("b");
self::i = false;
self::j = new self::B::•("b");
- self::j = let final dynamic #t12 = false in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:58:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::B'.\n j = /*error:INVALID_ASSIGNMENT*/ false;\n ^"));
- self::j = let final dynamic #t13 = <dynamic>[] in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:59:58: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'test::B'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::B'.\n j = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic*/ [];\n ^"));
+ self::j = let final dynamic #t13 = false in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:58:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::B'.\n j = /*error:INVALID_ASSIGNMENT*/ false;\n ^"));
+ self::j = let final dynamic #t14 = <dynamic>[] in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:59:58: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'test::B'.\nTry changing the type of the left hand side, or casting the right hand side to 'test::B'.\n j = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic*/ [];\n ^"));
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/rasta/malformed_const_constructor.dart.direct.expect b/pkg/front_end/testcases/rasta/malformed_const_constructor.dart.direct.expect
index e2a6950..3e1085f 100644
--- a/pkg/front_end/testcases/rasta/malformed_const_constructor.dart.direct.expect
+++ b/pkg/front_end/testcases/rasta/malformed_const_constructor.dart.direct.expect
@@ -3,9 +3,11 @@
import "dart:core" as core;
class A extends core::Object {
- const constructor •() → dynamic
- : invalid-initializer;
+ const constructor •() → void
+ : final dynamic #t1 = const core::_ConstantExpressionError::•()._throw(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/malformed_const_constructor.dart:7:7: Error: Setter not found: 'x'.\n : x = 'foo'\n ^"))
+ ;
}
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/rasta/malformed_const_constructor.dart:8:5: Error: Expected a function body, but got ':'.\n : x = 'foo'\n ^", "pkg/front_end/testcases/rasta/malformed_const_constructor.dart: Error: A const constructor can't have a body."]/* from null */;
static method main() → dynamic {
const self::A::•();
new self::A::•();
diff --git a/pkg/front_end/testcases/rasta/super.dart.direct.expect b/pkg/front_end/testcases/rasta/super.dart.direct.expect
index b891a38..23bb7ae 100644
--- a/pkg/front_end/testcases/rasta/super.dart.direct.expect
+++ b/pkg/front_end/testcases/rasta/super.dart.direct.expect
@@ -3,13 +3,14 @@
import "dart:core" as core;
class A extends core::Object {
- field dynamic a;
- field dynamic b;
- field dynamic c;
- field dynamic d;
- final field dynamic f;
- default constructor •() → self::A
- : super core::Object::•();
+ field dynamic a = null;
+ field dynamic b = null;
+ field dynamic c = null;
+ field dynamic d = null;
+ final field dynamic f = null;
+ default constructor •() → void
+ : super core::Object::•()
+ ;
get e() → dynamic
return null;
set g(dynamic _) → dynamic {}
@@ -32,24 +33,26 @@
set n(dynamic _) → dynamic {}
}
class B extends self::A {
- final field dynamic d;
- default constructor •() → self::B
- : super self::A::•();
+ final field dynamic d = null;
+ default constructor •() → void
+ : super self::A::•()
+ ;
get b() → dynamic
return null;
set c(dynamic x) → dynamic {}
set i(dynamic x) → dynamic {}
}
class C extends self::B {
- default constructor •() → self::C
- : super self::B::•();
+ default constructor •() → void
+ : super self::B::•()
+ ;
method test() → dynamic {
super.{self::A::~}();
self::use(super.{self::A::~}());
super.{self::A::unary-}();
self::use(super.{self::A::unary-}());
- invalid-expression;
- self::use(invalid-expression);
+ this.•.+(const core::_ConstantExpressionError::•()._throw(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:43:6: Error: Can't use `super` as an expression.\n +super;\n ^")));
+ self::use(this.•.+(const core::_ConstantExpressionError::•()._throw(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:44:10: Error: Can't use `super` as an expression.\n use(+super);\n ^"))));
super.{self::A::==}(87);
self::use(super.{self::A::==}(87));
!super.{self::A::==}(87);
@@ -76,56 +79,56 @@
self::use(super.{self::A::[]}(87));
super.{self::A::m};
self::use(super.{self::A::m});
- throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null));
+ super.{self::A::n};
+ self::use(super.{self::A::n});
super.{self::A::a} = super.{self::A::a}.+(1);
self::use(let final dynamic #t1 = super.{self::A::a} in let final dynamic #t2 = super.{self::A::a} = #t1.+(1) in #t1);
super.{self::A::b} = super.{self::B::b}.+(1);
self::use(let final dynamic #t3 = super.{self::B::b} in let final dynamic #t4 = super.{self::A::b} = #t3.+(1) in #t3);
super.{self::B::c} = super.{self::A::c}.+(1);
self::use(let final dynamic #t5 = super.{self::A::c} in let final dynamic #t6 = super.{self::B::c} = #t5.+(1) in #t5);
- super.d = super.{self::B::d}.+(1);
- self::use(let final dynamic #t7 = super.{self::B::d} in let final dynamic #t8 = super.d = #t7.+(1) in #t7);
+ super.{self::A::d} = super.{self::B::d}.+(1);
+ self::use(let final dynamic #t7 = super.{self::B::d} in let final dynamic #t8 = super.{self::A::d} = #t7.+(1) in #t7);
super.e = super.{self::A::e}.+(1);
self::use(let final dynamic #t9 = super.{self::A::e} in let final dynamic #t10 = super.e = #t9.+(1) in #t9);
super.f = super.{self::A::f}.+(1);
self::use(let final dynamic #t11 = super.{self::A::f} in let final dynamic #t12 = super.f = #t11.+(1) in #t11);
- throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null));
+ super.{self::A::g} = super.g.+(1);
+ self::use(let final dynamic #t13 = super.g in let final dynamic #t14 = super.{self::A::g} = #t13.+(1) in #t13);
super.{self::A::h} = super.{self::A::h}.+(1);
- self::use(let final dynamic #t13 = super.{self::A::h} in let final dynamic #t14 = super.{self::A::h} = #t13.+(1) in #t13);
+ self::use(let final dynamic #t15 = super.{self::A::h} in let final dynamic #t16 = super.{self::A::h} = #t15.+(1) in #t15);
super.{self::B::i} = super.{self::A::i}.+(1);
- self::use(let final dynamic #t15 = super.{self::A::i} in let final dynamic #t16 = super.{self::B::i} = #t15.+(1) in #t15);
- let final dynamic #t17 = 87 in super.{self::A::[]=}(#t17, super.{self::A::[]}(#t17).+(1));
- self::use(let final dynamic #t18 = 87 in let final dynamic #t19 = super.{self::A::[]}(#t18) in let final dynamic #t20 = super.{self::A::[]=}(#t18, #t19.+(1)) in #t19);
+ self::use(let final dynamic #t17 = super.{self::A::i} in let final dynamic #t18 = super.{self::B::i} = #t17.+(1) in #t17);
+ let final dynamic #t19 = 87 in super.{self::A::[]=}(#t19, super.{self::A::[]}(#t19).+(1));
+ self::use(let final dynamic #t20 = 87 in let final dynamic #t21 = super.{self::A::[]}(#t20) in let final dynamic #t22 = super.{self::A::[]=}(#t20, #t21.+(1)) in #t21);
super.m = super.{self::A::m}.+(1);
- self::use(let final dynamic #t21 = super.{self::A::m} in let final dynamic #t22 = super.m = #t21.+(1) in #t21);
- throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null));
+ self::use(let final dynamic #t23 = super.{self::A::m} in let final dynamic #t24 = super.m = #t23.+(1) in #t23);
+ super.{self::A::n} = super.{self::A::n}.+(1);
+ self::use(let final dynamic #t25 = super.{self::A::n} in let final dynamic #t26 = super.{self::A::n} = #t25.+(1) in #t25);
super.{self::A::a} = super.{self::A::a}.+(1);
self::use(super.{self::A::a} = super.{self::A::a}.+(1));
super.{self::A::b} = super.{self::B::b}.+(1);
self::use(super.{self::A::b} = super.{self::B::b}.+(1));
super.{self::B::c} = super.{self::A::c}.+(1);
self::use(super.{self::B::c} = super.{self::A::c}.+(1));
- super.d = super.{self::B::d}.+(1);
- self::use(super.d = super.{self::B::d}.+(1));
+ super.{self::A::d} = super.{self::B::d}.+(1);
+ self::use(super.{self::A::d} = super.{self::B::d}.+(1));
super.e = super.{self::A::e}.+(1);
self::use(super.e = super.{self::A::e}.+(1));
super.f = super.{self::A::f}.+(1);
self::use(super.f = super.{self::A::f}.+(1));
- throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null));
+ super.{self::A::g} = super.g.+(1);
+ self::use(super.{self::A::g} = super.g.+(1));
super.{self::A::h} = super.{self::A::h}.+(1);
self::use(super.{self::A::h} = super.{self::A::h}.+(1));
super.{self::B::i} = super.{self::A::i}.+(1);
self::use(super.{self::B::i} = super.{self::A::i}.+(1));
- let final dynamic #t23 = 87 in super.{self::A::[]=}(#t23, super.{self::A::[]}(#t23).+(1));
- self::use(let final dynamic #t24 = 87 in let final dynamic #t25 = super.{self::A::[]}(#t24).+(1) in let final dynamic #t26 = super.{self::A::[]=}(#t24, #t25) in #t25);
+ let final dynamic #t27 = 87 in let final dynamic #t28 = super.{self::A::[]}(#t27).+(1) in let final dynamic #t29 = super.{self::A::[]=}(#t27, #t28) in #t28;
+ self::use(let final dynamic #t30 = 87 in let final dynamic #t31 = super.{self::A::[]}(#t30).+(1) in let final dynamic #t32 = super.{self::A::[]=}(#t30, #t31) in #t31);
super.m = super.{self::A::m}.+(1);
self::use(super.m = super.{self::A::m}.+(1));
- throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null));
+ super.{self::A::n} = super.{self::A::n}.+(1);
+ self::use(super.{self::A::n} = super.{self::A::n}.+(1));
super.{self::A::a}.call();
self::use(super.{self::A::a}.call());
super.{self::B::b}.call();
@@ -138,8 +141,8 @@
self::use(super.{self::A::e}.call());
super.{self::A::f}.call();
self::use(super.{self::A::f}.call());
- super.g.call();
- self::use(super.g.call());
+ super.g();
+ self::use(super.g());
super.{self::A::h}.call();
self::use(super.{self::A::h}.call());
super.{self::A::i}.call();
@@ -150,16 +153,16 @@
self::use(super.{self::A::m}());
super.{self::A::m}(87);
self::use(super.{self::A::m}(87));
- throw core::_unresolvedSuperMethodError(this, #n, <dynamic>[87], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperMethodError(this, #n, <dynamic>[87], <dynamic, dynamic>{}, null));
+ super.{self::A::n}(87);
+ self::use(super.{self::A::n}(87));
super.{self::A::a} = 42;
self::use(super.{self::A::a} = 42);
super.{self::A::b} = 42;
self::use(super.{self::A::b} = 42);
super.{self::B::c} = 42;
self::use(super.{self::B::c} = 42);
- super.d = 42;
- self::use(super.d = 42);
+ super.{self::A::d} = 42;
+ self::use(super.{self::A::d} = 42);
super.e = 42;
self::use(super.e = 42);
super.f = 42;
@@ -171,85 +174,86 @@
super.{self::B::i} = 42;
self::use(super.{self::B::i} = 42);
super.{self::A::[]=}(87, 42);
- self::use(let final dynamic #t27 = 87 in let final dynamic #t28 = 42 in let final dynamic #t29 = super.{self::A::[]=}(#t27, #t28) in #t28);
+ self::use(let final dynamic #t33 = 87 in let final dynamic #t34 = 42 in let final dynamic #t35 = super.{self::A::[]=}(#t33, #t34) in #t34);
super.m = 42;
self::use(super.m = 42);
- throw core::_unresolvedSuperSetterError(this, #n, <dynamic>[42], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperSetterError(this, #n, <dynamic>[42], <dynamic, dynamic>{}, null));
+ super.{self::A::n} = 42;
+ self::use(super.{self::A::n} = 42);
super.{self::A::a}.==(null) ? super.{self::A::a} = 42 : null;
- self::use(let final dynamic #t30 = super.{self::A::a} in #t30.==(null) ? super.{self::A::a} = 42 : #t30);
+ self::use(let final dynamic #t36 = super.{self::A::a} in #t36.==(null) ? super.{self::A::a} = 42 : #t36);
super.{self::B::b}.==(null) ? super.{self::A::b} = 42 : null;
- self::use(let final dynamic #t31 = super.{self::B::b} in #t31.==(null) ? super.{self::A::b} = 42 : #t31);
+ self::use(let final dynamic #t37 = super.{self::B::b} in #t37.==(null) ? super.{self::A::b} = 42 : #t37);
super.{self::A::c}.==(null) ? super.{self::B::c} = 42 : null;
- self::use(let final dynamic #t32 = super.{self::A::c} in #t32.==(null) ? super.{self::B::c} = 42 : #t32);
- super.{self::B::d}.==(null) ? super.d = 42 : null;
- self::use(let final dynamic #t33 = super.{self::B::d} in #t33.==(null) ? super.d = 42 : #t33);
+ self::use(let final dynamic #t38 = super.{self::A::c} in #t38.==(null) ? super.{self::B::c} = 42 : #t38);
+ super.{self::B::d}.==(null) ? super.{self::A::d} = 42 : null;
+ self::use(let final dynamic #t39 = super.{self::B::d} in #t39.==(null) ? super.{self::A::d} = 42 : #t39);
super.{self::A::e}.==(null) ? super.e = 42 : null;
- self::use(let final dynamic #t34 = super.{self::A::e} in #t34.==(null) ? super.e = 42 : #t34);
+ self::use(let final dynamic #t40 = super.{self::A::e} in #t40.==(null) ? super.e = 42 : #t40);
super.{self::A::f}.==(null) ? super.f = 42 : null;
- self::use(let final dynamic #t35 = super.{self::A::f} in #t35.==(null) ? super.f = 42 : #t35);
- throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null));
+ self::use(let final dynamic #t41 = super.{self::A::f} in #t41.==(null) ? super.f = 42 : #t41);
+ super.g.==(null) ? super.{self::A::g} = 42 : null;
+ self::use(let final dynamic #t42 = super.g in #t42.==(null) ? super.{self::A::g} = 42 : #t42);
super.{self::A::h}.==(null) ? super.{self::A::h} = 42 : null;
- self::use(let final dynamic #t36 = super.{self::A::h} in #t36.==(null) ? super.{self::A::h} = 42 : #t36);
+ self::use(let final dynamic #t43 = super.{self::A::h} in #t43.==(null) ? super.{self::A::h} = 42 : #t43);
super.{self::A::i}.==(null) ? super.{self::B::i} = 42 : null;
- self::use(let final dynamic #t37 = super.{self::A::i} in #t37.==(null) ? super.{self::B::i} = 42 : #t37);
- let final dynamic #t38 = 87 in super.{self::A::[]}(#t38).==(null) ? super.{self::A::[]=}(#t38, 42) : null;
- self::use(let final dynamic #t39 = 87 in let final dynamic #t40 = super.{self::A::[]}(#t39) in #t40.==(null) ? let final dynamic #t41 = 42 in let final dynamic #t42 = super.{self::A::[]=}(#t39, #t41) in #t41 : #t40);
+ self::use(let final dynamic #t44 = super.{self::A::i} in #t44.==(null) ? super.{self::B::i} = 42 : #t44);
+ let final dynamic #t45 = 87 in super.{self::A::[]}(#t45).==(null) ? let final dynamic #t46 = 42 in let final dynamic #t47 = super.{self::A::[]=}(#t45, #t46) in #t46 : null;
+ self::use(let final dynamic #t48 = 87 in let final dynamic #t49 = super.{self::A::[]}(#t48) in #t49.==(null) ? let final dynamic #t50 = 42 in let final dynamic #t51 = super.{self::A::[]=}(#t48, #t50) in #t50 : #t49);
super.{self::A::m}.==(null) ? super.m = 42 : null;
- self::use(let final dynamic #t43 = super.{self::A::m} in #t43.==(null) ? super.m = 42 : #t43);
- throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null));
+ self::use(let final dynamic #t52 = super.{self::A::m} in #t52.==(null) ? super.m = 42 : #t52);
+ super.{self::A::n}.==(null) ? super.{self::A::n} = 42 : null;
+ self::use(let final dynamic #t53 = super.{self::A::n} in #t53.==(null) ? super.{self::A::n} = 42 : #t53);
super.{self::A::a} = super.{self::A::a}.+(42);
self::use(super.{self::A::a} = super.{self::A::a}.+(42));
super.{self::A::b} = super.{self::B::b}.+(42);
self::use(super.{self::A::b} = super.{self::B::b}.+(42));
super.{self::B::c} = super.{self::A::c}.+(42);
self::use(super.{self::B::c} = super.{self::A::c}.+(42));
- super.d = super.{self::B::d}.+(42);
- self::use(super.d = super.{self::B::d}.+(42));
+ super.{self::A::d} = super.{self::B::d}.+(42);
+ self::use(super.{self::A::d} = super.{self::B::d}.+(42));
super.e = super.{self::A::e}.+(42);
self::use(super.e = super.{self::A::e}.+(42));
super.f = super.{self::A::f}.+(42);
self::use(super.f = super.{self::A::f}.+(42));
- throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null));
+ super.{self::A::g} = super.g.+(42);
+ self::use(super.{self::A::g} = super.g.+(42));
super.{self::A::h} = super.{self::A::h}.+(42);
self::use(super.{self::A::h} = super.{self::A::h}.+(42));
super.{self::B::i} = super.{self::A::i}.+(42);
self::use(super.{self::B::i} = super.{self::A::i}.+(42));
- let final dynamic #t44 = 87 in super.{self::A::[]=}(#t44, super.{self::A::[]}(#t44).+(42));
- self::use(let final dynamic #t45 = 87 in let final dynamic #t46 = super.{self::A::[]}(#t45).+(42) in let final dynamic #t47 = super.{self::A::[]=}(#t45, #t46) in #t46);
+ let final dynamic #t54 = 87 in super.{self::A::[]=}(#t54, super.{self::A::[]}(#t54).+(42));
+ self::use(let final dynamic #t55 = 87 in let final dynamic #t56 = super.{self::A::[]}(#t55).+(42) in let final dynamic #t57 = super.{self::A::[]=}(#t55, #t56) in #t56);
super.m = super.{self::A::m}.+(42);
self::use(super.m = super.{self::A::m}.+(42));
- throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null));
+ super.{self::A::n} = super.{self::A::n}.+(42);
+ self::use(super.{self::A::n} = super.{self::A::n}.+(42));
super.{self::A::a} = super.{self::A::a}.-(42);
self::use(super.{self::A::a} = super.{self::A::a}.-(42));
super.{self::A::b} = super.{self::B::b}.-(42);
self::use(super.{self::A::b} = super.{self::B::b}.-(42));
super.{self::B::c} = super.{self::A::c}.-(42);
self::use(super.{self::B::c} = super.{self::A::c}.-(42));
- super.d = super.{self::B::d}.-(42);
- self::use(super.d = super.{self::B::d}.-(42));
+ super.{self::A::d} = super.{self::B::d}.-(42);
+ self::use(super.{self::A::d} = super.{self::B::d}.-(42));
super.e = super.{self::A::e}.-(42);
self::use(super.e = super.{self::A::e}.-(42));
super.f = super.{self::A::f}.-(42);
self::use(super.f = super.{self::A::f}.-(42));
- throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #g, <dynamic>[], <dynamic, dynamic>{}, null));
+ super.{self::A::g} = super.g.-(42);
+ self::use(super.{self::A::g} = super.g.-(42));
super.{self::A::h} = super.{self::A::h}.-(42);
self::use(super.{self::A::h} = super.{self::A::h}.-(42));
super.{self::B::i} = super.{self::A::i}.-(42);
self::use(super.{self::B::i} = super.{self::A::i}.-(42));
- let final dynamic #t48 = 87 in super.{self::A::[]=}(#t48, super.{self::A::[]}(#t48).-(42));
- self::use(let final dynamic #t49 = 87 in let final dynamic #t50 = super.{self::A::[]}(#t49).-(42) in let final dynamic #t51 = super.{self::A::[]=}(#t49, #t50) in #t50);
+ let final dynamic #t58 = 87 in super.{self::A::[]=}(#t58, super.{self::A::[]}(#t58).-(42));
+ self::use(let final dynamic #t59 = 87 in let final dynamic #t60 = super.{self::A::[]}(#t59).-(42) in let final dynamic #t61 = super.{self::A::[]=}(#t59, #t60) in #t60);
super.m = super.{self::A::m}.-(42);
self::use(super.m = super.{self::A::m}.-(42));
- throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null);
- self::use(throw core::_unresolvedSuperGetterError(this, #n, <dynamic>[], <dynamic, dynamic>{}, null));
+ super.{self::A::n} = super.{self::A::n}.-(42);
+ self::use(super.{self::A::n} = super.{self::A::n}.-(42));
}
}
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/rasta/super.dart:43:5: Error: '+' is not a prefix operator.\nTry removing '+'.\n +super;\n ^", "pkg/front_end/testcases/rasta/super.dart:44:9: Error: '+' is not a prefix operator.\nTry removing '+'.\n use(+super);\n ^"]/* from null */;
static method use(dynamic x) → dynamic {
if(x.==(new core::DateTime::now().millisecondsSinceEpoch))
throw "Shouldn't happen";
diff --git a/pkg/front_end/testcases/rasta/super.dart.strong.expect b/pkg/front_end/testcases/rasta/super.dart.strong.expect
index a45aca6..e4997f7 100644
--- a/pkg/front_end/testcases/rasta/super.dart.strong.expect
+++ b/pkg/front_end/testcases/rasta/super.dart.strong.expect
@@ -51,8 +51,8 @@
self::use(super.{self::A::~}());
super.{self::A::unary-}();
self::use(super.{self::A::unary-}());
- const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:43:6: Error: Can't use `super` as an expression.\n +super;\n ^"));
- self::use(const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:44:10: Error: Can't use `super` as an expression.\n use(+super);\n ^")));
+ (let final dynamic #t1 = this in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:43:5: Error: The getter '' isn't defined for the class '#lib1::C'.\nTry correcting the name to the name of an existing getter, or defining a getter or field named ''.\n +super;\n ^"))).+(const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:43:6: Error: Can't use `super` as an expression.\n +super;\n ^")));
+ self::use((let final dynamic #t2 = this in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:44:9: Error: The getter '' isn't defined for the class '#lib1::C'.\nTry correcting the name to the name of an existing getter, or defining a getter or field named ''.\n use(+super);\n ^"))).+(const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:44:10: Error: Can't use `super` as an expression.\n use(+super);\n ^"))));
super.{self::A::==}(87);
self::use(super.{self::A::==}(87));
!super.{self::A::==}(87);
@@ -82,29 +82,29 @@
super.{self::A::n};
self::use(super.{self::A::n});
super.{self::A::a} = super.{self::A::a}.+(1);
- self::use(let final dynamic #t1 = super.{self::A::a} in let final dynamic #t2 = super.{self::A::a} = #t1.+(1) in #t1);
+ self::use(let final dynamic #t3 = super.{self::A::a} in let final dynamic #t4 = super.{self::A::a} = #t3.+(1) in #t3);
super.{self::A::b} = super.{self::B::b}.+(1);
- self::use(let final dynamic #t3 = super.{self::B::b} in let final dynamic #t4 = super.{self::A::b} = #t3.+(1) in #t3);
+ self::use(let final dynamic #t5 = super.{self::B::b} in let final dynamic #t6 = super.{self::A::b} = #t5.+(1) in #t5);
super.{self::B::c} = super.{self::A::c}.+(1);
- self::use(let final dynamic #t5 = super.{self::A::c} in let final dynamic #t6 = super.{self::B::c} = #t5.+(1) in #t5);
+ self::use(let final dynamic #t7 = super.{self::A::c} in let final dynamic #t8 = super.{self::B::c} = #t7.+(1) in #t7);
super.{self::A::d} = super.{self::B::d}.+(1);
- self::use(let final dynamic #t7 = super.{self::B::d} in let final dynamic #t8 = super.{self::A::d} = #t7.+(1) in #t7);
+ self::use(let final dynamic #t9 = super.{self::B::d} in let final dynamic #t10 = super.{self::A::d} = #t9.+(1) in #t9);
super.e = super.{self::A::e}.+(1);
- self::use(let final dynamic #t9 = super.{self::A::e} in let final dynamic #t10 = super.e = #t9.+(1) in #t9);
+ self::use(let final dynamic #t11 = super.{self::A::e} in let final dynamic #t12 = super.e = #t11.+(1) in #t11);
super.f = super.{self::A::f}.+(1);
- self::use(let final dynamic #t11 = super.{self::A::f} in let final dynamic #t12 = super.f = #t11.+(1) in #t11);
+ self::use(let final dynamic #t13 = super.{self::A::f} in let final dynamic #t14 = super.f = #t13.+(1) in #t13);
super.{self::A::g} = super.g.+(1);
- self::use(let final dynamic #t13 = super.g in let final dynamic #t14 = super.{self::A::g} = #t13.+(1) in #t13);
+ self::use(let final dynamic #t15 = super.g in let final dynamic #t16 = super.{self::A::g} = #t15.+(1) in #t15);
super.{self::A::h} = super.{self::A::h}.+(1);
- self::use(let final dynamic #t15 = super.{self::A::h} in let final dynamic #t16 = super.{self::A::h} = #t15.+(1) in #t15);
+ self::use(let final dynamic #t17 = super.{self::A::h} in let final dynamic #t18 = super.{self::A::h} = #t17.+(1) in #t17);
super.{self::B::i} = super.{self::A::i}.+(1);
- self::use(let final dynamic #t17 = super.{self::A::i} in let final dynamic #t18 = super.{self::B::i} = #t17.+(1) in #t17);
- let final core::int #t19 = 87 in super.{self::A::[]=}(#t19, super.{self::A::[]}(#t19).+(1));
- self::use(let final core::int #t20 = 87 in let final dynamic #t21 = super.{self::A::[]}(#t20) in let final void #t22 = super.{self::A::[]=}(#t20, #t21.+(1)) in #t21);
- super.m = super.{self::A::m}.+(1);
- self::use(let final () → void #t23 = super.{self::A::m} in let final dynamic #t24 = super.m = #t23.+(1) in #t23);
- super.{self::A::n} = super.{self::A::n}.+(1);
- self::use(let final () → void #t25 = super.{self::A::n} in let final dynamic #t26 = super.{self::A::n} = #t25.+(1) in #t25);
+ self::use(let final dynamic #t19 = super.{self::A::i} in let final dynamic #t20 = super.{self::B::i} = #t19.+(1) in #t19);
+ let final core::int #t21 = 87 in super.{self::A::[]=}(#t21, super.{self::A::[]}(#t21).+(1));
+ self::use(let final core::int #t22 = 87 in let final dynamic #t23 = super.{self::A::[]}(#t22) in let final void #t24 = super.{self::A::[]=}(#t22, #t23.+(1)) in #t23);
+ super.m = let final dynamic #t25 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:95:12: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n super.m++;\n ^"));
+ self::use(let final () → void #t26 = super.{self::A::m} in let final dynamic #t27 = super.m = let final dynamic #t28 = #t26 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:96:16: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n use(super.m++);\n ^")) in #t26);
+ super.{self::A::n} = let final dynamic #t29 = super.{self::A::n} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:97:12: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n super.n++;\n ^"));
+ self::use(let final () → void #t30 = super.{self::A::n} in let final dynamic #t31 = super.{self::A::n} = let final dynamic #t32 = #t30 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:98:16: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n use(super.n++);\n ^")) in #t30);
super.{self::A::a} = super.{self::A::a}.+(1);
self::use(super.{self::A::a} = super.{self::A::a}.+(1));
super.{self::A::b} = super.{self::B::b}.+(1);
@@ -123,12 +123,12 @@
self::use(super.{self::A::h} = super.{self::A::h}.+(1));
super.{self::B::i} = super.{self::A::i}.+(1);
self::use(super.{self::B::i} = super.{self::A::i}.+(1));
- let final core::int #t27 = 87 in let final dynamic #t28 = super.{self::A::[]}(#t27).+(1) in let final void #t29 = super.{self::A::[]=}(#t27, #t28) in #t28;
- self::use(let final core::int #t30 = 87 in let final dynamic #t31 = super.{self::A::[]}(#t30).+(1) in let final void #t32 = super.{self::A::[]=}(#t30, #t31) in #t31);
- super.m = super.{self::A::m}.+(1);
- self::use(super.m = super.{self::A::m}.+(1));
- super.{self::A::n} = super.{self::A::n}.+(1);
- self::use(super.{self::A::n} = super.{self::A::n}.+(1));
+ let final core::int #t33 = 87 in let final dynamic #t34 = super.{self::A::[]}(#t33).+(1) in let final void #t35 = super.{self::A::[]=}(#t33, #t34) in #t34;
+ self::use(let final core::int #t36 = 87 in let final dynamic #t37 = super.{self::A::[]}(#t36).+(1) in let final void #t38 = super.{self::A::[]=}(#t36, #t37) in #t37);
+ super.m = let final dynamic #t39 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:120:5: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n ++super.m;\n ^"));
+ self::use(super.m = let final dynamic #t40 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:121:9: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n use(++super.m);\n ^")));
+ super.{self::A::n} = let final dynamic #t41 = super.{self::A::n} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:122:5: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n ++super.n;\n ^"));
+ self::use(super.{self::A::n} = let final dynamic #t42 = super.{self::A::n} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:123:9: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n use(++super.n);\n ^")));
super.{self::A::a}.call();
self::use(super.{self::A::a}.call());
super.{self::B::b}.call();
@@ -174,35 +174,35 @@
super.{self::B::i} = 42;
self::use(super.{self::B::i} = 42);
super.{self::A::[]=}(87, 42);
- self::use(let final core::int #t33 = 87 in let final core::int #t34 = 42 in let final void #t35 = super.{self::A::[]=}(#t33, #t34) in #t34);
+ self::use(let final core::int #t43 = 87 in let final core::int #t44 = 42 in let final void #t45 = super.{self::A::[]=}(#t43, #t44) in #t44);
super.m = 42;
self::use(super.m = 42);
super.{self::A::n} = 42;
self::use(super.{self::A::n} = 42);
super.{self::A::a}.{core::Object::==}(null) ?{dynamic} super.{self::A::a} = 42 : null;
- self::use(let final dynamic #t36 = super.{self::A::a} in #t36.{core::Object::==}(null) ?{dynamic} super.{self::A::a} = 42 : #t36);
+ self::use(let final dynamic #t46 = super.{self::A::a} in #t46.{core::Object::==}(null) ?{dynamic} super.{self::A::a} = 42 : #t46);
super.{self::B::b}.{core::Object::==}(null) ?{dynamic} super.{self::A::b} = 42 : null;
- self::use(let final dynamic #t37 = super.{self::B::b} in #t37.{core::Object::==}(null) ?{dynamic} super.{self::A::b} = 42 : #t37);
+ self::use(let final dynamic #t47 = super.{self::B::b} in #t47.{core::Object::==}(null) ?{dynamic} super.{self::A::b} = 42 : #t47);
super.{self::A::c}.{core::Object::==}(null) ?{dynamic} super.{self::B::c} = 42 : null;
- self::use(let final dynamic #t38 = super.{self::A::c} in #t38.{core::Object::==}(null) ?{dynamic} super.{self::B::c} = 42 : #t38);
+ self::use(let final dynamic #t48 = super.{self::A::c} in #t48.{core::Object::==}(null) ?{dynamic} super.{self::B::c} = 42 : #t48);
super.{self::B::d}.{core::Object::==}(null) ?{dynamic} super.{self::A::d} = 42 : null;
- self::use(let final dynamic #t39 = super.{self::B::d} in #t39.{core::Object::==}(null) ?{dynamic} super.{self::A::d} = 42 : #t39);
+ self::use(let final dynamic #t49 = super.{self::B::d} in #t49.{core::Object::==}(null) ?{dynamic} super.{self::A::d} = 42 : #t49);
super.{self::A::e}.{core::Object::==}(null) ?{dynamic} super.e = 42 : null;
- self::use(let final dynamic #t40 = super.{self::A::e} in #t40.{core::Object::==}(null) ?{dynamic} super.e = 42 : #t40);
+ self::use(let final dynamic #t50 = super.{self::A::e} in #t50.{core::Object::==}(null) ?{dynamic} super.e = 42 : #t50);
super.{self::A::f}.{core::Object::==}(null) ?{dynamic} super.f = 42 : null;
- self::use(let final dynamic #t41 = super.{self::A::f} in #t41.{core::Object::==}(null) ?{dynamic} super.f = 42 : #t41);
+ self::use(let final dynamic #t51 = super.{self::A::f} in #t51.{core::Object::==}(null) ?{dynamic} super.f = 42 : #t51);
super.g.{core::Object::==}(null) ?{dynamic} super.{self::A::g} = 42 : null;
- self::use(let final dynamic #t42 = super.g in #t42.{core::Object::==}(null) ?{dynamic} super.{self::A::g} = 42 : #t42);
+ self::use(let final dynamic #t52 = super.g in #t52.{core::Object::==}(null) ?{dynamic} super.{self::A::g} = 42 : #t52);
super.{self::A::h}.{core::Object::==}(null) ?{dynamic} super.{self::A::h} = 42 : null;
- self::use(let final dynamic #t43 = super.{self::A::h} in #t43.{core::Object::==}(null) ?{dynamic} super.{self::A::h} = 42 : #t43);
+ self::use(let final dynamic #t53 = super.{self::A::h} in #t53.{core::Object::==}(null) ?{dynamic} super.{self::A::h} = 42 : #t53);
super.{self::A::i}.{core::Object::==}(null) ?{dynamic} super.{self::B::i} = 42 : null;
- self::use(let final dynamic #t44 = super.{self::A::i} in #t44.{core::Object::==}(null) ?{dynamic} super.{self::B::i} = 42 : #t44);
- let final core::int #t45 = 87 in super.{self::A::[]}(#t45).{core::Object::==}(null) ?{dynamic} let final core::int #t46 = 42 in let final void #t47 = super.{self::A::[]=}(#t45, #t46) in #t46 : null;
- self::use(let final core::int #t48 = 87 in let final dynamic #t49 = super.{self::A::[]}(#t48) in #t49.{core::Object::==}(null) ?{dynamic} let final core::int #t50 = 42 in let final void #t51 = super.{self::A::[]=}(#t48, #t50) in #t50 : #t49);
+ self::use(let final dynamic #t54 = super.{self::A::i} in #t54.{core::Object::==}(null) ?{dynamic} super.{self::B::i} = 42 : #t54);
+ let final core::int #t55 = 87 in super.{self::A::[]}(#t55).{core::Object::==}(null) ?{dynamic} let final core::int #t56 = 42 in let final void #t57 = super.{self::A::[]=}(#t55, #t56) in #t56 : null;
+ self::use(let final core::int #t58 = 87 in let final dynamic #t59 = super.{self::A::[]}(#t58) in #t59.{core::Object::==}(null) ?{dynamic} let final core::int #t60 = 42 in let final void #t61 = super.{self::A::[]=}(#t58, #t60) in #t60 : #t59);
super.{self::A::m}.{core::Object::==}(null) ?{core::Object} super.m = 42 : null;
- self::use(let final () → void #t52 = super.{self::A::m} in #t52.{core::Object::==}(null) ?{core::Object} super.m = 42 : #t52);
+ self::use(let final () → void #t62 = super.{self::A::m} in #t62.{core::Object::==}(null) ?{core::Object} super.m = 42 : #t62);
super.{self::A::n}.{core::Object::==}(null) ?{core::Object} super.{self::A::n} = 42 : null;
- self::use(let final () → void #t53 = super.{self::A::n} in #t53.{core::Object::==}(null) ?{core::Object} super.{self::A::n} = 42 : #t53);
+ self::use(let final () → void #t63 = super.{self::A::n} in #t63.{core::Object::==}(null) ?{core::Object} super.{self::A::n} = 42 : #t63);
super.{self::A::a} = super.{self::A::a}.+(42);
self::use(super.{self::A::a} = super.{self::A::a}.+(42));
super.{self::A::b} = super.{self::B::b}.+(42);
@@ -221,12 +221,12 @@
self::use(super.{self::A::h} = super.{self::A::h}.+(42));
super.{self::B::i} = super.{self::A::i}.+(42);
self::use(super.{self::B::i} = super.{self::A::i}.+(42));
- let final core::int #t54 = 87 in super.{self::A::[]=}(#t54, super.{self::A::[]}(#t54).+(42));
- self::use(let final core::int #t55 = 87 in let final dynamic #t56 = super.{self::A::[]}(#t55).+(42) in let final void #t57 = super.{self::A::[]=}(#t55, #t56) in #t56);
- super.m = super.{self::A::m}.+(42);
- self::use(super.m = super.{self::A::m}.+(42));
- super.{self::A::n} = super.{self::A::n}.+(42);
- self::use(super.{self::A::n} = super.{self::A::n}.+(42));
+ let final core::int #t64 = 87 in super.{self::A::[]=}(#t64, super.{self::A::[]}(#t64).+(42));
+ self::use(let final core::int #t65 = 87 in let final dynamic #t66 = super.{self::A::[]}(#t65).+(42) in let final void #t67 = super.{self::A::[]=}(#t65, #t66) in #t66);
+ super.m = let final dynamic #t68 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:222:13: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n super.m += 42;\n ^"));
+ self::use(super.m = let final dynamic #t69 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:223:17: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n use(super.m += 42);\n ^")));
+ super.{self::A::n} = let final dynamic #t70 = super.{self::A::n} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:224:13: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n super.n += 42;\n ^"));
+ self::use(super.{self::A::n} = let final dynamic #t71 = super.{self::A::n} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:225:17: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n use(super.n += 42);\n ^")));
super.{self::A::a} = super.{self::A::a}.-(42);
self::use(super.{self::A::a} = super.{self::A::a}.-(42));
super.{self::A::b} = super.{self::B::b}.-(42);
@@ -245,12 +245,12 @@
self::use(super.{self::A::h} = super.{self::A::h}.-(42));
super.{self::B::i} = super.{self::A::i}.-(42);
self::use(super.{self::B::i} = super.{self::A::i}.-(42));
- let final core::int #t58 = 87 in super.{self::A::[]=}(#t58, super.{self::A::[]}(#t58).-(42));
- self::use(let final core::int #t59 = 87 in let final dynamic #t60 = super.{self::A::[]}(#t59).-(42) in let final void #t61 = super.{self::A::[]=}(#t59, #t60) in #t60);
- super.m = super.{self::A::m}.-(42);
- self::use(super.m = super.{self::A::m}.-(42));
- super.{self::A::n} = super.{self::A::n}.-(42);
- self::use(super.{self::A::n} = super.{self::A::n}.-(42));
+ let final core::int #t72 = 87 in super.{self::A::[]=}(#t72, super.{self::A::[]}(#t72).-(42));
+ self::use(let final core::int #t73 = 87 in let final dynamic #t74 = super.{self::A::[]}(#t73).-(42) in let final void #t75 = super.{self::A::[]=}(#t73, #t74) in #t74);
+ super.m = let final dynamic #t76 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:247:13: Error: The method '-' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '-'.\n super.m -= 42;\n ^"));
+ self::use(super.m = let final dynamic #t77 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:248:17: Error: The method '-' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '-'.\n use(super.m -= 42);\n ^")));
+ super.{self::A::n} = let final dynamic #t78 = super.{self::A::n} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:249:13: Error: The method '-' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '-'.\n super.n -= 42;\n ^"));
+ self::use(super.{self::A::n} = let final dynamic #t79 = super.{self::A::n} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/rasta/super.dart:250:17: Error: The method '-' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '-'.\n use(super.n -= 42);\n ^")));
}
}
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/rasta/super.dart:43:5: Error: '+' is not a prefix operator.\nTry removing '+'.\n +super;\n ^", "pkg/front_end/testcases/rasta/super.dart:44:9: Error: '+' is not a prefix operator.\nTry removing '+'.\n use(+super);\n ^"]/* from null */;
diff --git a/pkg/front_end/testcases/shaker/empty_program.dart.outline.expect b/pkg/front_end/testcases/shaker/empty_program.dart.outline.expect
index 63495ce..54d7983 100644
--- a/pkg/front_end/testcases/shaker/empty_program.dart.outline.expect
+++ b/pkg/front_end/testcases/shaker/empty_program.dart.outline.expect
@@ -193,6 +193,7 @@
import "dart:_internal" as _in;
import "dart:math" as math;
+typedef _SyncGeneratorCallback<T extends self::Object> = (self::_SyncIterator<T>) → self::bool;
class _SyncIterable<T extends self::Object> extends col::IterableBase<self::_SyncIterable::T> {
const constructor •((self::_SyncIterator<self::_SyncIterable::T>) → self::bool _moveNextFn) → void;
get iterator() → self::Iterator<self::_SyncIterable::T>;
diff --git a/pkg/front_end/testcases/shaker/empty_program.dart.shaker.expect b/pkg/front_end/testcases/shaker/empty_program.dart.shaker.expect
index d0985d2..5c54176 100644
--- a/pkg/front_end/testcases/shaker/empty_program.dart.shaker.expect
+++ b/pkg/front_end/testcases/shaker/empty_program.dart.shaker.expect
@@ -149,6 +149,7 @@
library dart:core:
- member print
+ - typedef _SyncGeneratorCallback
- class _SyncIterable
- (default constructor)
- iterator
diff --git a/pkg/front_end/testcases/strong.status b/pkg/front_end/testcases/strong.status
index 8b12cbf..36cc99b 100644
--- a/pkg/front_end/testcases/strong.status
+++ b/pkg/front_end/testcases/strong.status
@@ -11,6 +11,7 @@
argument_mismatch: TypeCheckError
async_function: Fail
await: Fail
+bug21938: TypeCheckError
bug30695: TypeCheckError
bug31124: RuntimeError # Test has an intentional error
call: Fail
@@ -59,7 +60,7 @@
uninitialized_fields: Fail
unused_methods: Fail
void_methods: Fail
-warn_unresolved_sends: TypeCheckError
+warn_unresolved_sends: RuntimeError # Test assumes Dart 1.0 semantics
inference/abstract_class_instantiation: Fail # Issue #30040
inference/block_bodied_lambdas_infer_bottom_async_star: RuntimeError
@@ -75,9 +76,7 @@
inference/downwards_inference_annotations_parameter_local: Fail # Issue #28434
inference/downwards_inference_annotations_type_variable: Fail # Issue #28434
inference/downwards_inference_annotations_type_variable_local: Fail # Issue #28434
-inference/downwards_inference_on_function_expressions: TypeCheckError
inference/downwards_inference_on_function_of_t_using_the_t: Fail # Issue #29798
-inference/downwards_inference_on_generic_function_expressions: TypeCheckError
inference/downwards_inference_on_list_literals_infer_downwards: RuntimeError
inference/downwards_inference_yield_yield_star: TypeCheckError
inference/future_then_2: TypeCheckError
@@ -96,11 +95,9 @@
inference/generic_methods_do_not_infer_invalid_override_of_generic_method: TypeCheckError
inference/generic_methods_handle_override_of_non_generic_with_generic: TypeCheckError
inference/generic_methods_infer_js_builtin: Fail # Issue #30029
-inference/generic_methods_iterable_and_future: TypeCheckError
inference/generic_methods_nested_generic_instantiation: RuntimeError # Issue #31304
inference/generic_methods_uses_greatest_lower_bound: RuntimeError
inference/infer_field_override_multiple: TypeCheckError
-inference/infer_from_complex_expressions_if_outer_most_value_is_precise: TypeCheckError
inference/infer_method_missing_params: TypeCheckError
inference/infer_type_regardless_of_declaration_order_or_cycles: RuntimeError
inference/infer_types_on_generic_instantiations_4: RuntimeError
diff --git a/pkg/front_end/testcases/super_rasta_copy.dart.strong.expect b/pkg/front_end/testcases/super_rasta_copy.dart.strong.expect
index 3d9c1e0..d809ae2 100644
--- a/pkg/front_end/testcases/super_rasta_copy.dart.strong.expect
+++ b/pkg/front_end/testcases/super_rasta_copy.dart.strong.expect
@@ -95,8 +95,8 @@
self::use(let final dynamic #t17 = super.{self::A::i} in let final dynamic #t18 = super.{self::B::i} = #t17.+(1) in #t17);
let final core::int #t19 = 87 in super.{self::A::[]=}(#t19, super.{self::A::[]}(#t19).+(1));
self::use(let final core::int #t20 = 87 in let final dynamic #t21 = super.{self::A::[]}(#t20) in let final void #t22 = super.{self::A::[]=}(#t20, #t21.+(1)) in #t21);
- super.m = super.{self::A::m}.+(1);
- self::use(let final () → void #t23 = super.{self::A::m} in let final dynamic #t24 = super.m = #t23.+(1) in #t23);
+ super.m = let final dynamic #t23 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/super_rasta_copy.dart:91:12: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n super.m++;\n ^"));
+ self::use(let final () → void #t24 = super.{self::A::m} in let final dynamic #t25 = super.m = let final dynamic #t26 = #t24 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/super_rasta_copy.dart:92:16: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n use(super.m++);\n ^")) in #t24);
super.{self::A::a} = super.{self::A::a}.+(1);
self::use(super.{self::A::a} = super.{self::A::a}.+(1));
super.{self::A::b} = super.{self::B::b}.+(1);
@@ -115,10 +115,10 @@
self::use(super.{self::A::h} = super.{self::A::h}.+(1));
super.{self::B::i} = super.{self::A::i}.+(1);
self::use(super.{self::B::i} = super.{self::A::i}.+(1));
- let final core::int #t25 = 87 in let final dynamic #t26 = super.{self::A::[]}(#t25).+(1) in let final void #t27 = super.{self::A::[]=}(#t25, #t26) in #t26;
- self::use(let final core::int #t28 = 87 in let final dynamic #t29 = super.{self::A::[]}(#t28).+(1) in let final void #t30 = super.{self::A::[]=}(#t28, #t29) in #t29);
- super.m = super.{self::A::m}.+(1);
- self::use(super.m = super.{self::A::m}.+(1));
+ let final core::int #t27 = 87 in let final dynamic #t28 = super.{self::A::[]}(#t27).+(1) in let final void #t29 = super.{self::A::[]=}(#t27, #t28) in #t28;
+ self::use(let final core::int #t30 = 87 in let final dynamic #t31 = super.{self::A::[]}(#t30).+(1) in let final void #t32 = super.{self::A::[]=}(#t30, #t31) in #t31);
+ super.m = let final dynamic #t33 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/super_rasta_copy.dart:114:5: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n ++super.m;\n ^"));
+ self::use(super.m = let final dynamic #t34 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/super_rasta_copy.dart:115:9: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n use(++super.m);\n ^")));
super.{self::A::a}.call();
self::use(super.{self::A::a}.call());
super.{self::B::b}.call();
@@ -162,31 +162,31 @@
super.{self::B::i} = 42;
self::use(super.{self::B::i} = 42);
super.{self::A::[]=}(87, 42);
- self::use(let final core::int #t31 = 87 in let final core::int #t32 = 42 in let final void #t33 = super.{self::A::[]=}(#t31, #t32) in #t32);
+ self::use(let final core::int #t35 = 87 in let final core::int #t36 = 42 in let final void #t37 = super.{self::A::[]=}(#t35, #t36) in #t36);
super.m = 42;
self::use(super.m = 42);
super.{self::A::a}.{core::Object::==}(null) ?{dynamic} super.{self::A::a} = 42 : null;
- self::use(let final dynamic #t34 = super.{self::A::a} in #t34.{core::Object::==}(null) ?{dynamic} super.{self::A::a} = 42 : #t34);
+ self::use(let final dynamic #t38 = super.{self::A::a} in #t38.{core::Object::==}(null) ?{dynamic} super.{self::A::a} = 42 : #t38);
super.{self::B::b}.{core::Object::==}(null) ?{dynamic} super.{self::A::b} = 42 : null;
- self::use(let final dynamic #t35 = super.{self::B::b} in #t35.{core::Object::==}(null) ?{dynamic} super.{self::A::b} = 42 : #t35);
+ self::use(let final dynamic #t39 = super.{self::B::b} in #t39.{core::Object::==}(null) ?{dynamic} super.{self::A::b} = 42 : #t39);
super.{self::A::c}.{core::Object::==}(null) ?{dynamic} super.{self::B::c} = 42 : null;
- self::use(let final dynamic #t36 = super.{self::A::c} in #t36.{core::Object::==}(null) ?{dynamic} super.{self::B::c} = 42 : #t36);
+ self::use(let final dynamic #t40 = super.{self::A::c} in #t40.{core::Object::==}(null) ?{dynamic} super.{self::B::c} = 42 : #t40);
super.{self::B::d}.{core::Object::==}(null) ?{dynamic} super.{self::A::d} = 42 : null;
- self::use(let final dynamic #t37 = super.{self::B::d} in #t37.{core::Object::==}(null) ?{dynamic} super.{self::A::d} = 42 : #t37);
+ self::use(let final dynamic #t41 = super.{self::B::d} in #t41.{core::Object::==}(null) ?{dynamic} super.{self::A::d} = 42 : #t41);
super.{self::A::e}.{core::Object::==}(null) ?{dynamic} super.e = 42 : null;
- self::use(let final dynamic #t38 = super.{self::A::e} in #t38.{core::Object::==}(null) ?{dynamic} super.e = 42 : #t38);
+ self::use(let final dynamic #t42 = super.{self::A::e} in #t42.{core::Object::==}(null) ?{dynamic} super.e = 42 : #t42);
super.{self::A::f}.{core::Object::==}(null) ?{dynamic} super.f = 42 : null;
- self::use(let final dynamic #t39 = super.{self::A::f} in #t39.{core::Object::==}(null) ?{dynamic} super.f = 42 : #t39);
+ self::use(let final dynamic #t43 = super.{self::A::f} in #t43.{core::Object::==}(null) ?{dynamic} super.f = 42 : #t43);
super.g.{core::Object::==}(null) ?{dynamic} super.{self::A::g} = 42 : null;
- self::use(let final dynamic #t40 = super.g in #t40.{core::Object::==}(null) ?{dynamic} super.{self::A::g} = 42 : #t40);
+ self::use(let final dynamic #t44 = super.g in #t44.{core::Object::==}(null) ?{dynamic} super.{self::A::g} = 42 : #t44);
super.{self::A::h}.{core::Object::==}(null) ?{dynamic} super.{self::A::h} = 42 : null;
- self::use(let final dynamic #t41 = super.{self::A::h} in #t41.{core::Object::==}(null) ?{dynamic} super.{self::A::h} = 42 : #t41);
+ self::use(let final dynamic #t45 = super.{self::A::h} in #t45.{core::Object::==}(null) ?{dynamic} super.{self::A::h} = 42 : #t45);
super.{self::A::i}.{core::Object::==}(null) ?{dynamic} super.{self::B::i} = 42 : null;
- self::use(let final dynamic #t42 = super.{self::A::i} in #t42.{core::Object::==}(null) ?{dynamic} super.{self::B::i} = 42 : #t42);
- let final core::int #t43 = 87 in super.{self::A::[]}(#t43).{core::Object::==}(null) ?{dynamic} let final core::int #t44 = 42 in let final void #t45 = super.{self::A::[]=}(#t43, #t44) in #t44 : null;
- self::use(let final core::int #t46 = 87 in let final dynamic #t47 = super.{self::A::[]}(#t46) in #t47.{core::Object::==}(null) ?{dynamic} let final core::int #t48 = 42 in let final void #t49 = super.{self::A::[]=}(#t46, #t48) in #t48 : #t47);
+ self::use(let final dynamic #t46 = super.{self::A::i} in #t46.{core::Object::==}(null) ?{dynamic} super.{self::B::i} = 42 : #t46);
+ let final core::int #t47 = 87 in super.{self::A::[]}(#t47).{core::Object::==}(null) ?{dynamic} let final core::int #t48 = 42 in let final void #t49 = super.{self::A::[]=}(#t47, #t48) in #t48 : null;
+ self::use(let final core::int #t50 = 87 in let final dynamic #t51 = super.{self::A::[]}(#t50) in #t51.{core::Object::==}(null) ?{dynamic} let final core::int #t52 = 42 in let final void #t53 = super.{self::A::[]=}(#t50, #t52) in #t52 : #t51);
super.{self::A::m}.{core::Object::==}(null) ?{core::Object} super.m = 42 : null;
- self::use(let final () → void #t50 = super.{self::A::m} in #t50.{core::Object::==}(null) ?{core::Object} super.m = 42 : #t50);
+ self::use(let final () → void #t54 = super.{self::A::m} in #t54.{core::Object::==}(null) ?{core::Object} super.m = 42 : #t54);
super.{self::A::a} = super.{self::A::a}.+(42);
self::use(super.{self::A::a} = super.{self::A::a}.+(42));
super.{self::A::b} = super.{self::B::b}.+(42);
@@ -205,10 +205,10 @@
self::use(super.{self::A::h} = super.{self::A::h}.+(42));
super.{self::B::i} = super.{self::A::i}.+(42);
self::use(super.{self::B::i} = super.{self::A::i}.+(42));
- let final core::int #t51 = 87 in super.{self::A::[]=}(#t51, super.{self::A::[]}(#t51).+(42));
- self::use(let final core::int #t52 = 87 in let final dynamic #t53 = super.{self::A::[]}(#t52).+(42) in let final void #t54 = super.{self::A::[]=}(#t52, #t53) in #t53);
- super.m = super.{self::A::m}.+(42);
- self::use(super.m = super.{self::A::m}.+(42));
+ let final core::int #t55 = 87 in super.{self::A::[]=}(#t55, super.{self::A::[]}(#t55).+(42));
+ self::use(let final core::int #t56 = 87 in let final dynamic #t57 = super.{self::A::[]}(#t56).+(42) in let final void #t58 = super.{self::A::[]=}(#t56, #t57) in #t57);
+ super.m = let final dynamic #t59 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/super_rasta_copy.dart:208:13: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n super.m += 42;\n ^"));
+ self::use(super.m = let final dynamic #t60 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/super_rasta_copy.dart:209:17: Error: The method '+' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '+'.\n use(super.m += 42);\n ^")));
super.{self::A::a} = super.{self::A::a}.-(42);
self::use(super.{self::A::a} = super.{self::A::a}.-(42));
super.{self::A::b} = super.{self::B::b}.-(42);
@@ -227,10 +227,10 @@
self::use(super.{self::A::h} = super.{self::A::h}.-(42));
super.{self::B::i} = super.{self::A::i}.-(42);
self::use(super.{self::B::i} = super.{self::A::i}.-(42));
- let final core::int #t55 = 87 in super.{self::A::[]=}(#t55, super.{self::A::[]}(#t55).-(42));
- self::use(let final core::int #t56 = 87 in let final dynamic #t57 = super.{self::A::[]}(#t56).-(42) in let final void #t58 = super.{self::A::[]=}(#t56, #t57) in #t57);
- super.m = super.{self::A::m}.-(42);
- self::use(super.m = super.{self::A::m}.-(42));
+ let final core::int #t61 = 87 in super.{self::A::[]=}(#t61, super.{self::A::[]}(#t61).-(42));
+ self::use(let final core::int #t62 = 87 in let final dynamic #t63 = super.{self::A::[]}(#t62).-(42) in let final void #t64 = super.{self::A::[]=}(#t62, #t63) in #t63);
+ super.m = let final dynamic #t65 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/super_rasta_copy.dart:231:13: Error: The method '-' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '-'.\n super.m -= 42;\n ^"));
+ self::use(super.m = let final dynamic #t66 = super.{self::A::m} in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/super_rasta_copy.dart:232:17: Error: The method '-' isn't defined for the class '() \u8594 void'.\nTry correcting the name to the name of an existing method, or defining a method named '-'.\n use(super.m -= 42);\n ^")));
}
}
static method use(dynamic x) → dynamic {
diff --git a/pkg/front_end/testcases/type_variable_as_super.dart.direct.expect b/pkg/front_end/testcases/type_variable_as_super.dart.direct.expect
index fd84fc7..adce035 100644
--- a/pkg/front_end/testcases/type_variable_as_super.dart.direct.expect
+++ b/pkg/front_end/testcases/type_variable_as_super.dart.direct.expect
@@ -17,7 +17,7 @@
: super core::Object::•()
;
}
-const field dynamic #errors = const <dynamic>["Error: The type variable 'T' can't be used as supertype.", "Error: The type variable 'T' can't be used as supertype.", "Error: The type variable 'T' can't be used as supertype."]/* from null */;
+static const field dynamic #errors = const <dynamic>["Error: The type variable 'T' can't be used as supertype.", "Error: The type variable 'T' can't be used as supertype.", "Error: The type variable 'T' can't be used as supertype."]/* from null */;
static method main() → dynamic {
throw new core::AbstractClassInstantiationError::•("A");
throw new core::AbstractClassInstantiationError::•("B");
diff --git a/pkg/front_end/testcases/undefined.dart b/pkg/front_end/testcases/undefined.dart
new file mode 100644
index 0000000..d94de88
--- /dev/null
+++ b/pkg/front_end/testcases/undefined.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/*@testedFeatures=error*/
+
+class C {
+ var x;
+ void f() {}
+}
+
+void test(C c) {
+ c.x;
+ c. /*@error=UndefinedGetter*/ y;
+ c.f();
+ c. /*@error=UndefinedMethod*/ g();
+ c.x = null;
+ c. /*@error=UndefinedSetter*/ y = null;
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/undefined.dart.direct.expect b/pkg/front_end/testcases/undefined.dart.direct.expect
new file mode 100644
index 0000000..cfc1ec6
--- /dev/null
+++ b/pkg/front_end/testcases/undefined.dart.direct.expect
@@ -0,0 +1,20 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+ field dynamic x = null;
+ default constructor •() → void
+ : super core::Object::•()
+ ;
+ method f() → void {}
+}
+static method test(self::C c) → void {
+ c.x;
+ c.y;
+ c.f();
+ c.g();
+ c.x = null;
+ c.y = null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/undefined.dart.outline.expect b/pkg/front_end/testcases/undefined.dart.outline.expect
new file mode 100644
index 0000000..82b8592
--- /dev/null
+++ b/pkg/front_end/testcases/undefined.dart.outline.expect
@@ -0,0 +1,15 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+ field dynamic x;
+ default constructor •() → void
+ ;
+ method f() → void
+ ;
+}
+static method test(self::C c) → void
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/undefined.dart.strong.expect b/pkg/front_end/testcases/undefined.dart.strong.expect
new file mode 100644
index 0000000..4562a4e
--- /dev/null
+++ b/pkg/front_end/testcases/undefined.dart.strong.expect
@@ -0,0 +1,20 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+ field dynamic x = null;
+ default constructor •() → void
+ : super core::Object::•()
+ ;
+ method f() → void {}
+}
+static method test(self::C c) → void {
+ c.{self::C::x};
+ let final dynamic #t1 = c in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/undefined.dart:14:33: Error: The getter 'y' isn't defined for the class '#lib1::C'.\nTry correcting the name to the name of an existing getter, or defining a getter or field named 'y'.\n c. /*@error=UndefinedGetter*/ y;\n ^"));
+ c.{self::C::f}();
+ let final dynamic #t2 = c in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/undefined.dart:16:33: Error: The method 'g' isn't defined for the class '#lib1::C'.\nTry correcting the name to the name of an existing method, or defining a method named 'g'.\n c. /*@error=UndefinedMethod*/ g();\n ^"));
+ c.{self::C::x} = null;
+ let final dynamic #t3 = c in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/undefined.dart:18:33: Error: The setter 'y' isn't defined for the class '#lib1::C'.\nTry correcting the name to the name of an existing setter, or defining a setter or field named 'y'.\n c. /*@error=UndefinedSetter*/ y = null;\n ^"));
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart b/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart
new file mode 100644
index 0000000..b107e62
--- /dev/null
+++ b/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/*@testedFeatures=error*/
+
+class C {
+ void set x(value);
+}
+
+void test(C c) {
+ c.x = 1; // Ok
+ c. /*@error=UndefinedGetter*/ x += 1;
+ c. /*@error=UndefinedGetter*/ x ??= 1;
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart.direct.expect b/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart.direct.expect
new file mode 100644
index 0000000..a2ed83c
--- /dev/null
+++ b/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart.direct.expect
@@ -0,0 +1,16 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+ default constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract set x(dynamic value) → void;
+}
+static method test(self::C c) → void {
+ c.x = 1;
+ let final dynamic #t1 = c in #t1.x = #t1.x.+(1);
+ let final dynamic #t2 = c in #t2.x.==(null) ? #t2.x = 1 : null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart.outline.expect b/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart.outline.expect
new file mode 100644
index 0000000..cb360bd
--- /dev/null
+++ b/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart.outline.expect
@@ -0,0 +1,13 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+ default constructor •() → void
+ ;
+ abstract set x(dynamic value) → void;
+}
+static method test(self::C c) → void
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart.strong.expect b/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart.strong.expect
new file mode 100644
index 0000000..3d93d26
--- /dev/null
+++ b/pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart.strong.expect
@@ -0,0 +1,16 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class C extends core::Object {
+ default constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract set x(dynamic value) → void;
+}
+static method test(self::C c) → void {
+ c.{self::C::x} = 1;
+ let final self::C #t1 = c in #t1.{self::C::x} = (let final dynamic #t2 = #t1 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart:13:33: Error: The getter 'x' isn't defined for the class '#lib1::C'.\nTry correcting the name to the name of an existing getter, or defining a getter or field named 'x'.\n c. /*@error=UndefinedGetter*/ x += 1;\n ^"))).+(1);
+ let final self::C #t3 = c in (let final dynamic #t4 = #t3 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/undefined_getter_in_compound_assignment.dart:14:33: Error: The getter 'x' isn't defined for the class '#lib1::C'.\nTry correcting the name to the name of an existing getter, or defining a getter or field named 'x'.\n c. /*@error=UndefinedGetter*/ x ??= 1;\n ^"))).{core::Object::==}(null) ?{dynamic} #t3.{self::C::x} = 1 : null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/warn_unresolved_sends.dart.strong.expect b/pkg/front_end/testcases/warn_unresolved_sends.dart.strong.expect
index 98637d9..aac9d0a 100644
--- a/pkg/front_end/testcases/warn_unresolved_sends.dart.strong.expect
+++ b/pkg/front_end/testcases/warn_unresolved_sends.dart.strong.expect
@@ -45,12 +45,12 @@
this.{self::D::setterOnly} = 0;
this.{self::D::getterOnly};
this.{self::C::getterOnly} = 0;
- this.missingField;
- this.missingField = 0;
- this.missingMethod();
- this.missingField;
- this.missingField = 0;
- this.missingMethod();
+ let final dynamic #t1 = this in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/warn_unresolved_sends.dart:49:39: Error: The getter 'missingField' isn't defined for the class '#lib1::D'.\nTry correcting the name to the name of an existing getter, or defining a getter or field named 'missingField'.\n this. /*@warning=GetterNotFound*/ missingField;\n ^"));
+ let final dynamic #t2 = this in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/warn_unresolved_sends.dart:50:39: Error: The setter 'missingField' isn't defined for the class '#lib1::D'.\nTry correcting the name to the name of an existing setter, or defining a setter or field named 'missingField'.\n this. /*@warning=SetterNotFound*/ missingField = 0;\n ^"));
+ let final dynamic #t3 = this in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/warn_unresolved_sends.dart:51:39: Error: The method 'missingMethod' isn't defined for the class '#lib1::D'.\nTry correcting the name to the name of an existing method, or defining a method named 'missingMethod'.\n this. /*@warning=MethodNotFound*/ missingMethod();\n ^"));
+ let final dynamic #t4 = this in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/warn_unresolved_sends.dart:53:33: Error: The getter 'missingField' isn't defined for the class '#lib1::D'.\nTry correcting the name to the name of an existing getter, or defining a getter or field named 'missingField'.\n /*@warning=GetterNotFound*/ missingField;\n ^"));
+ let final dynamic #t5 = this in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/warn_unresolved_sends.dart:54:33: Error: The setter 'missingField' isn't defined for the class '#lib1::D'.\nTry correcting the name to the name of an existing setter, or defining a setter or field named 'missingField'.\n /*@warning=SetterNotFound*/ missingField = 0;\n ^"));
+ let final dynamic #t6 = this in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/warn_unresolved_sends.dart:55:33: Error: The method 'missingMethod' isn't defined for the class '#lib1::D'.\nTry correcting the name to the name of an existing method, or defining a method named 'missingMethod'.\n /*@warning=MethodNotFound*/ missingMethod();\n ^"));
}
}
class E extends self::D {
diff --git a/pkg/front_end/tool/bazel/worker.dart b/pkg/front_end/tool/bazel/worker.dart
index d49ca87..cd19f9f 100644
--- a/pkg/front_end/tool/bazel/worker.dart
+++ b/pkg/front_end/tool/bazel/worker.dart
@@ -9,6 +9,8 @@
import 'package:front_end/src/api_prototype/front_end.dart'
hide FileSystemException;
import 'package:front_end/src/fasta/command_line_reporting.dart';
+import 'package:front_end/src/multi_root_file_system.dart';
+import 'package:front_end/src/api_prototype/physical_file_system.dart';
import 'package:kernel/target/targets.dart';
main(List<String> args) async {
@@ -100,11 +102,18 @@
exit(0);
}
+ // Bazel creates an overlay file system where some files may be located in the
+ // source tree, some in a gendir, and some in a bindir. The multi-root file
+ // system hides this from the front end.
+ var fileSystem = new MultiRootFileSystem(
+ 'org-dartlang-multi-root',
+ parsedArgs['multi-root'].map(Uri.parse).toList(),
+ PhysicalFileSystem.instance);
var options = new CompilerOptions()
..packagesFileUri = Uri.parse(parsedArgs['packages-file'])
..inputSummaries = parsedArgs['input-summary'].map(Uri.parse).toList()
..sdkSummary = Uri.parse(parsedArgs['dart-sdk-summary'])
- ..multiRoots = parsedArgs['multi-root'].map(Uri.parse).toList()
+ ..fileSystem = fileSystem
..target = new NoneTarget(new TargetFlags());
options.onError = (CompilationMessage error) {
diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart
index 0979ecd..78e0ebf 100644
--- a/pkg/kernel/lib/ast.dart
+++ b/pkg/kernel/lib/ast.dart
@@ -4842,7 +4842,8 @@
if (typeParameters.isEmpty) return this;
return new FunctionType(positionalParameters, returnType,
requiredParameterCount: requiredParameterCount,
- namedParameters: namedParameters);
+ namedParameters: namedParameters,
+ typedefReference: typedefReference);
}
/// Looks up the type of the named parameter with the given name.
diff --git a/pkg/kernel/lib/type_algebra.dart b/pkg/kernel/lib/type_algebra.dart
index 2401edd..5b2ab4e 100644
--- a/pkg/kernel/lib/type_algebra.dart
+++ b/pkg/kernel/lib/type_algebra.dart
@@ -446,7 +446,8 @@
return new FunctionType(positionalParameters, returnType,
namedParameters: namedParameters,
typeParameters: typeParameters,
- requiredParameterCount: node.requiredParameterCount);
+ requiredParameterCount: node.requiredParameterCount,
+ typedefReference: node.typedefReference);
}
void bumpCountersUntil(_TypeSubstitutor target) {
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 4c454cf..993d8e5 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -24,6 +24,7 @@
analyzer/test/generated/static_warning_code_kernel_test: Slow, Pass
analyzer/test/generated/strong_mode_kernel_test: Slow, Pass
analyzer/test/generated/compile_time_error_code_test: Slow, Pass
+analyzer/test/src/dart/analysis/driver_kernel_test: Slow, Pass
analyzer/test/src/summary/resynthesize_kernel_test: Slow, Pass
analyzer/test/src/task/strong/checker_test: Slow, Pass
analyzer_plugin/test/plugin/folding_mixin_test: Slow, Pass
diff --git a/pkg/vm/bin/kernel_service.dart b/pkg/vm/bin/kernel_service.dart
index 2b234dd..96d5b96 100644
--- a/pkg/vm/bin/kernel_service.dart
+++ b/pkg/vm/bin/kernel_service.dart
@@ -246,7 +246,7 @@
return new HybridFileSystem(fileSystem);
}
-train(String scriptUri) {
+train(String scriptUri, String platformKernel) {
// TODO(28532): Enable on Windows.
if (Platform.isWindows) return;
@@ -267,7 +267,7 @@
tag,
responsePort.sendPort,
scriptUri,
- null /* platformKernel */,
+ platformKernel,
false /* incremental */,
false /* strong */,
1 /* isolateId chosen randomly */,
@@ -277,10 +277,10 @@
}
main([args]) {
- if (args?.length == 2 && args[0] == '--train') {
+ if ((args?.length ?? 0) > 1 && args[0] == '--train') {
// This entry point is used when creating an app snapshot. The argument
// provides a script to compile to warm-up generated code.
- train(args[1]);
+ train(args[1], args.length > 2 ? args[2] : null);
} else {
// Entry point for the Kernel isolate.
return new RawReceivePort()..handler = _processLoadRequest;
diff --git a/pkg/vm/bin/precompiler_kernel_front_end.dart b/pkg/vm/bin/precompiler_kernel_front_end.dart
new file mode 100644
index 0000000..4a0ddae
--- /dev/null
+++ b/pkg/vm/bin/precompiler_kernel_front_end.dart
@@ -0,0 +1,87 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+import 'package:args/args.dart' show ArgParser, ArgResults;
+import 'package:front_end/src/api_prototype/front_end.dart';
+import 'package:kernel/binary/ast_to_binary.dart';
+import 'package:kernel/kernel.dart' show Program;
+import 'package:kernel/target/targets.dart' show TargetFlags;
+import 'package:kernel/target/vm.dart' show VmTarget;
+import 'package:vm/kernel_front_end.dart' show compileToKernel;
+
+final ArgParser _argParser = new ArgParser(allowTrailingOptions: true)
+ ..addOption('platform',
+ help: 'Path to vm_platform_strong.dill file', defaultsTo: null)
+ ..addOption('packages', help: 'Path to .packages file', defaultsTo: null)
+ ..addOption('output',
+ abbr: 'o', help: 'Path to resulting dill file', defaultsTo: null)
+ ..addFlag('strong-mode', help: 'Enable strong mode', defaultsTo: true);
+
+final String _usage = '''
+Usage: dart pkg/vm/bin/precompiler_kernel_front_end.dart --platform vm_platform_strong.dill [options] input.dart
+Compiles Dart sources to a kernel binary file for the Dart 2.0 AOT compiler.
+
+Options:
+${_argParser.usage}
+''';
+
+const int _badUsageExitCode = 1;
+const int _compileTimeErrorExitCode = 250;
+
+const _severityCaptions = const <Severity, String>{
+ Severity.error: 'Error: ',
+ Severity.internalProblem: 'Internal problem: ',
+ Severity.nit: 'Nit: ',
+ Severity.warning: 'Warning: ',
+};
+
+main(List<String> arguments) async {
+ final ArgResults options = _argParser.parse(arguments);
+ final String platformKernel = options['platform'];
+
+ if ((options.rest.length != 1) || (platformKernel == null)) {
+ print(_usage);
+ exit(_badUsageExitCode);
+ }
+
+ final String filename = options.rest.single;
+ final String kernelBinaryFilename = options['output'] ?? "$filename.dill";
+ final String packages = options['packages'];
+ final bool strongMode = options['strong-mode'];
+
+ int errors = 0;
+
+ final CompilerOptions compilerOptions = new CompilerOptions()
+ ..strongMode = strongMode
+ ..target = new VmTarget(new TargetFlags(strongMode: strongMode))
+ ..linkedDependencies = <Uri>[Uri.base.resolve(platformKernel)]
+ ..packagesFileUri = packages != null ? Uri.base.resolve(packages) : null
+ ..reportMessages = true
+ ..onError = (CompilationMessage message) {
+ final severity = _severityCaptions[message.severity] ?? '';
+ final text = message.span?.message(message.message) ?? message.message;
+ final tip = message.tip != null ? "\n${message.tip}" : '';
+ print("$severity$text$tip");
+
+ if ((message.severity != Severity.nit) &&
+ (message.severity != Severity.warning)) {
+ ++errors;
+ }
+ };
+
+ Program program = await compileToKernel(
+ Uri.base.resolve(filename), compilerOptions,
+ aot: true);
+
+ if ((errors > 0) || (program == null)) {
+ exit(_compileTimeErrorExitCode);
+ }
+
+ final IOSink sink = new File(kernelBinaryFilename).openWrite();
+ final BinaryPrinter printer = new BinaryPrinter(sink);
+ printer.writeProgramFile(program);
+ await sink.close();
+}
diff --git a/pkg/vm/lib/kernel_front_end.dart b/pkg/vm/lib/kernel_front_end.dart
index 97b0ceb..fe25f0e 100644
--- a/pkg/vm/lib/kernel_front_end.dart
+++ b/pkg/vm/lib/kernel_front_end.dart
@@ -26,7 +26,7 @@
{bool aot: false}) async {
final program = await kernelForProgram(source, options);
- if (aot) {
+ if (aot && (program != null)) {
_runGlobalTransformations(program, options.strongMode);
}
diff --git a/pkg/vm/pubspec.yaml b/pkg/vm/pubspec.yaml
index 28dfc20..66ed423 100644
--- a/pkg/vm/pubspec.yaml
+++ b/pkg/vm/pubspec.yaml
@@ -8,3 +8,5 @@
dependencies:
front_end: 0.1.0-alpha.6
kernel: 0.3.0-alpha.3
+dev_dependencies:
+ args: ^0.13.0
diff --git a/pkg/vm/tool/precompiler2 b/pkg/vm/tool/precompiler2
index 8bf4431..83c6e4a 100755
--- a/pkg/vm/tool/precompiler2
+++ b/pkg/vm/tool/precompiler2
@@ -55,21 +55,20 @@
# Handle the case where dart-sdk/bin has been symlinked to.
CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
+SDK_DIR="$CUR_DIR/../../.."
+
if [[ `uname` == 'Darwin' ]]; then
- OUT_DIR="$CUR_DIR"/../../../xcodebuild/
+ OUT_DIR="$SDK_DIR/xcodebuild"
else
- OUT_DIR="$CUR_DIR"/../../../out/
+ OUT_DIR="$SDK_DIR/out"
fi
export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
-BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
+BIN_DIR="$OUT_DIR/$DART_CONFIGURATION"
# Step 1: Generate Kernel binary from the input Dart source.
-"$BIN_DIR"/dart pkg/front_end/tool/_fasta/compile.dart \
- --strong-mode \
- --platform "${BIN_DIR}"/vm_platform_strong.dill \
- --target vm \
- --target-options=strong-aot \
+"$BIN_DIR"/dart "${SDK_DIR}/pkg/vm/bin/precompiler_kernel_front_end.dart" \
+ --platform "${BIN_DIR}/vm_platform_strong.dill" \
$PACKAGES \
-o "$SNAPSHOT_FILE.dill" \
"$SOURCE_FILE"
diff --git a/runtime/bin/loader.cc b/runtime/bin/loader.cc
index e816e53..a2215e7 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -301,20 +301,21 @@
for (intptr_t i = 0; i < dependencies->length(); i++) {
char* resolved_uri = (*dependencies)[i];
- uint8_t* scoped_file_path = NULL;
- intptr_t scoped_file_path_length = -1;
+ uint8_t* file_path = NULL;
+ intptr_t file_path_length = -1;
Dart_Handle uri = Dart_NewStringFromCString(resolved_uri);
ASSERT(!Dart_IsError(uri));
- Dart_Handle result = Loader::ResolveAsFilePath(uri, &scoped_file_path,
- &scoped_file_path_length);
+ Dart_Handle result =
+ Loader::ResolveAsFilePath(uri, &file_path, &file_path_length);
if (Dart_IsError(result)) {
Log::Print("Error resolving dependency: %s\n", Dart_GetError(result));
return;
}
- (*dependencies)[i] =
- StringUtils::StrNDup(reinterpret_cast<const char*>(scoped_file_path),
- scoped_file_path_length);
+ // Convert buffer buffer to NUL-terminated string.
+ (*dependencies)[i] = StringUtils::StrNDup(
+ reinterpret_cast<const char*>(file_path), file_path_length);
+ free(file_path);
free(resolved_uri);
}
}
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 04c5431..2f4be2d 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -756,6 +756,12 @@
Dart_EnterScope();
if (Options::gen_snapshot_kind() == kScript) {
+ if (vm_run_app_snapshot) {
+ Log::PrintErr("Cannot create a script snapshot from an app snapshot.\n");
+ // The snapshot would contain references to the app snapshot instead of
+ // the core snapshot.
+ Platform::Exit(kErrorExitCode);
+ }
Snapshot::GenerateScript(Options::snapshot_filename());
} else {
// Lookup the library of the root script.
diff --git a/runtime/bin/run_vm_tests.cc b/runtime/bin/run_vm_tests.cc
index 4588c59..d69253ad 100644
--- a/runtime/bin/run_vm_tests.cc
+++ b/runtime/bin/run_vm_tests.cc
@@ -6,10 +6,13 @@
#include "bin/dartutils.h"
#include "bin/dfe.h"
+#include "bin/eventhandler.h"
#include "bin/file.h"
#include "bin/loader.h"
#include "bin/platform.h"
#include "bin/snapshot_utils.h"
+#include "bin/thread.h"
+#include "bin/utils.h"
#include "platform/assert.h"
#include "vm/benchmark_test.h"
#include "vm/dart.h"
@@ -238,6 +241,10 @@
dart_argv = &argv[1];
}
+ bin::Thread::InitOnce();
+ bin::TimerUtils::InitOnce();
+ bin::EventHandler::Start();
+
bool set_vm_flags_success =
Flags::ProcessCommandLineFlags(dart_argc, dart_argv);
ASSERT(set_vm_flags_success);
@@ -259,6 +266,8 @@
err_msg = Dart::Cleanup();
ASSERT(err_msg == NULL);
+ bin::EventHandler::Stop();
+
TestCaseBase::RunAllRaw();
// Print a warning message if no tests or benchmarks were matched.
if (run_matches == 0) {
diff --git a/runtime/bin/stdio_android.cc b/runtime/bin/stdio_android.cc
index 44a7fe7..5b6323f 100644
--- a/runtime/bin/stdio_android.cc
+++ b/runtime/bin/stdio_android.cc
@@ -18,8 +18,8 @@
namespace bin {
bool Stdin::ReadByte(int* byte) {
- int c = NO_RETRY_EXPECTED(getchar());
- if ((c == EOF) && (errno != 0)) {
+ const int c = NO_RETRY_EXPECTED(fgetc(stdin));
+ if ((c == EOF) && (ferror(stdin) != 0)) {
return false;
}
*byte = (c == EOF) ? -1 : c;
diff --git a/runtime/bin/stdio_linux.cc b/runtime/bin/stdio_linux.cc
index a6eddbe..8973bc5 100644
--- a/runtime/bin/stdio_linux.cc
+++ b/runtime/bin/stdio_linux.cc
@@ -18,8 +18,8 @@
namespace bin {
bool Stdin::ReadByte(int* byte) {
- int c = NO_RETRY_EXPECTED(getchar());
- if ((c == EOF) && (errno != 0)) {
+ const int c = NO_RETRY_EXPECTED(fgetc(stdin));
+ if ((c == EOF) && (ferror(stdin) != 0)) {
return false;
}
*byte = (c == EOF) ? -1 : c;
diff --git a/runtime/bin/stdio_macos.cc b/runtime/bin/stdio_macos.cc
index 0c8760a..a43c43b 100644
--- a/runtime/bin/stdio_macos.cc
+++ b/runtime/bin/stdio_macos.cc
@@ -18,8 +18,8 @@
namespace bin {
bool Stdin::ReadByte(int* byte) {
- int c = NO_RETRY_EXPECTED(getchar());
- if ((c == EOF) && (errno != 0)) {
+ const int c = NO_RETRY_EXPECTED(fgetc(stdin));
+ if ((c == EOF) && (ferror(stdin) != 0)) {
return false;
}
*byte = (c == EOF) ? -1 : c;
diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart
index 0f41850..7cec446 100644
--- a/runtime/bin/vmservice/vmservice_io.dart
+++ b/runtime/bin/vmservice/vmservice_io.dart
@@ -187,7 +187,7 @@
}
}
-_clearFuture(_) {
+Null _clearFuture(_) {
serverFuture = null;
}
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 8121ea5..4f6873a 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -569,12 +569,6 @@
Object::VerifyBuiltinVtables();
DEBUG_ONLY(I->heap()->Verify(kForbidMarked));
- {
- NOT_IN_PRODUCT(TimelineDurationScope tds(T, Timeline::GetIsolateStream(),
- "StubCode::Init"));
- StubCode::Init(I);
- }
-
#if defined(DART_PRECOMPILED_RUNTIME)
// AOT: The megamorphic miss function and code come from the snapshot.
ASSERT(I->object_store()->megamorphic_miss_code() != Code::null());
diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc
index f70090a..9bd84f1 100644
--- a/runtime/vm/stub_code.cc
+++ b/runtime/vm/stub_code.cc
@@ -79,8 +79,6 @@
}
#endif // defined(DART_PRECOMPILED_RUNTIME)
-void StubCode::Init(Isolate* isolate) {}
-
void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) {}
bool StubCode::HasBeenInitialized() {
diff --git a/runtime/vm/stub_code.h b/runtime/vm/stub_code.h
index 4d2b583..744e9e2 100644
--- a/runtime/vm/stub_code.h
+++ b/runtime/vm/stub_code.h
@@ -125,10 +125,6 @@
// only once and the stub code resides in the vm_isolate heap.
static void InitOnce();
- // Generate all stubs which are generated on a per isolate basis as they
- // have embedded objects which are isolate specific.
- static void Init(Isolate* isolate);
-
static void VisitObjectPointers(ObjectPointerVisitor* visitor);
// Returns true if stub code has been initialized.
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
index f4d83d9..9b17c9d 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
@@ -120,11 +120,11 @@
_globalState.currentContext = rootContext;
if (entry is _MainFunctionArgs) {
rootContext.eval(() {
- entry(args);
+ (entry as dynamic)(args);
});
} else if (entry is _MainFunctionArgsMessage) {
rootContext.eval(() {
- entry(args, null);
+ (entry as dynamic)(args, null);
});
} else {
rootContext.eval(entry);
diff --git a/sdk/lib/internal/print.dart b/sdk/lib/internal/print.dart
index c3e23b8..417003b 100644
--- a/sdk/lib/internal/print.dart
+++ b/sdk/lib/internal/print.dart
@@ -12,6 +12,6 @@
*
* This decouples the core library from the async library.
*/
-Function printToZone = null;
+void Function(String) printToZone = null;
external void printToConsole(String line);
diff --git a/tests/compiler/dart2js/inlining/inlining_test.dart b/tests/compiler/dart2js/inlining/inlining_test.dart
index a00a987..77511ea 100644
--- a/tests/compiler/dart2js/inlining/inlining_test.dart
+++ b/tests/compiler/dart2js/inlining/inlining_test.dart
@@ -26,13 +26,7 @@
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await checkTests(
dataDir, computeMemberAstInlinings, computeMemberIrInlinings,
- args: args,
- skipForKernel: [
- // TODO(sra,johnniwinther): Handle this for kernel.
- 'constructor.dart',
- 'dynamic.dart',
- 'force_inline_loops.dart',
- ]);
+ args: args);
});
}
diff --git a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
index ac71d51..b324d78 100644
--- a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
@@ -2034,13 +2034,6 @@
const Test('''
m() => !0;
''', const Visit(VisitKind.VISIT_NOT, expression: '0')),
- const Test('''
- m() => +false;
- ''',
- // TODO(johnniwinther): Should this be an
- // ERROR_UNDEFINED_UNARY_EXPRESSION? Currently the parser just skips
- // the `+`.
- const []),
],
'Index set': const [
// Index set
diff --git a/tests/compiler/dart2js/sourcemaps/data/others.dart b/tests/compiler/dart2js/sourcemaps/data/others.dart
index 13f6241..6d485a0 100644
--- a/tests/compiler/dart2js/sourcemaps/data/others.dart
+++ b/tests/compiler/dart2js/sourcemaps/data/others.dart
@@ -10,6 +10,10 @@
forLoop(false);
forInLoop([1]);
forInLoop([1, 2]);
+ forInLoopBreak([1]);
+ forInLoopBreak([1, 2]);
+ forInLoopContinue([1]);
+ forInLoopContinue([1, 2]);
forInLoopEmpty([]);
forInLoopNull(null);
doLoop(true);
@@ -25,10 +29,19 @@
c.captureTwice();
equals2(c, null);
equals2(c, c);
+ var c2 = new Class2();
+ c2.field1 = new Class2();
+ c2.field2 = new Class2();
+ c2 == c2.field1;
+ new Class3(87);
switchStatement(1);
switchStatement(0);
switchStatementConst(const Const(0));
switchStatementConst(const Const(1));
+ switchStatementBreak(0);
+ switchStatementBreak(1);
+ switchStatementBreakContinue(0);
+ switchStatementBreakContinue(1);
isInt(null);
isInt(0);
isDouble(null);
@@ -69,6 +82,24 @@
}
}
+forInLoopBreak(local) {
+ for (var e in local) {
+ if (e == 1) {
+ break;
+ }
+ print(e);
+ }
+}
+
+forInLoopContinue(local) {
+ for (var e in local) {
+ if (e == 1) {
+ continue;
+ }
+ print(e);
+ }
+}
+
forInLoopEmpty(local) {
for (var e in local) {
print(e);
@@ -127,6 +158,24 @@
return b != null && a.property1 == b.property1 && a.property2 == b.property2;
}
+class Class2 {
+ var field1;
+ var field2;
+
+ operator ==(other) {
+ return other != null && field1 == other.field1 && field2 == other.field2;
+ }
+}
+
+class Class3 {
+ var field1;
+ var field2;
+
+ Class3(this.field1) {
+ this.field2 = 42;
+ }
+}
+
switchStatement(a) {
switch (a) {
case 0:
@@ -155,6 +204,29 @@
}
}
+switchStatementBreak(a) {
+ switch (a) {
+ case 0:
+ break;
+ case 1:
+ return 2;
+ case 2:
+ break;
+ }
+}
+
+switchStatementBreakContinue(a) {
+ switch (a) {
+ case 0:
+ break;
+ label:
+ case 1:
+ return 2;
+ case 2:
+ continue label;
+ }
+}
+
isInt(e) {
e = e is int;
print(e);
diff --git a/tests/compiler/dart2js/sourcemaps/source_mapping_test.dart b/tests/compiler/dart2js/sourcemaps/source_mapping_test.dart
index 96b935c..e0dbefc 100644
--- a/tests/compiler/dart2js/sourcemaps/source_mapping_test.dart
+++ b/tests/compiler/dart2js/sourcemaps/source_mapping_test.dart
@@ -2,10 +2,23 @@
// 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 'helpers/sourcemap_helper.dart';
import 'tools/source_mapping_tester.dart';
void main() {
// 'operators.dart' and 'invokes.dart' are tested individually to avoid
// test timeout.
- test(['--exclude', 'operators.dart', 'invokes.dart']);
+ test(['--exclude', 'operators.dart', 'invokes.dart'],
+ whiteListFunction: (String config, String file) {
+ if (file == 'others.dart') {
+ return (CodePoint point) {
+ if (point.jsCode.startsWith('target=')) {
+ // Switch continue target updates don't store the source information.
+ return true;
+ }
+ return false;
+ };
+ }
+ return emptyWhiteList;
+ });
}
diff --git a/tests/compiler/dart2js/sourcemaps/tools/source_mapping_tester.dart b/tests/compiler/dart2js/sourcemaps/tools/source_mapping_tester.dart
index ce7a8f2..a7e9645 100644
--- a/tests/compiler/dart2js/sourcemaps/tools/source_mapping_tester.dart
+++ b/tests/compiler/dart2js/sourcemaps/tools/source_mapping_tester.dart
@@ -48,7 +48,6 @@
if (result.missingCodePointsMap.isNotEmpty) {
errorsFound =
result.printMissingCodePoints(whiteListFunction(config, file));
- true;
}
if (result.multipleNodesMap.isNotEmpty) {
result.printMultipleNodes();
diff --git a/tests/compiler/dart2js/value_range2_test.dart b/tests/compiler/dart2js/value_range2_test.dart
index 3d97c5e..f4b9376 100644
--- a/tests/compiler/dart2js/value_range2_test.dart
+++ b/tests/compiler/dart2js/value_range2_test.dart
@@ -9,8 +9,8 @@
ValueRangeInfo info = new ValueRangeInfo(const JavaScriptConstantSystem());
-Value instructionValue = info.newInstructionValue(new HBreak(null));
-Value lengthValue = info.newPositiveValue(new HBreak(null));
+Value instructionValue = info.newInstructionValue(new HBreak(null, null));
+Value lengthValue = info.newPositiveValue(new HBreak(null, null));
Range createSingleRange(Value value) => info.newNormalizedRange(value, value);
diff --git a/tests/compiler/dart2js_extra/dart2js_extra.status b/tests/compiler/dart2js_extra/dart2js_extra.status
index 33bb5e3..b84425a 100644
--- a/tests/compiler/dart2js_extra/dart2js_extra.status
+++ b/tests/compiler/dart2js_extra/dart2js_extra.status
@@ -270,20 +270,18 @@
[ $compiler == dart2js && $dart2js_with_kernel && $checked ]
21666_test: RuntimeError
-async_stacktrace_test: RuntimeError
closure_capture2_test: RuntimeError
closure_type_reflection2_test: RuntimeError
closure_type_reflection_test: RuntimeError
constant_javascript_semantics_test/01: MissingCompileTimeError
deferred/deferred_mirrors1_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
deferred/deferred_mirrors2_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred/multiple_default_arg_test: RuntimeError
deferred/reflect_multiple_annotations_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
deferred/reflect_multiple_default_arg_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
deferred/uninstantiated_type_variable_test: Crash # NoSuchMethodError: The method 'hasSubclass' was called on null.
deferred_custom_loader_test: RuntimeError
deferred_fail_and_retry_test: RuntimeError
-deferred_fail_and_retry_worker_test: RuntimeError
+deferred_fail_and_retry_worker_test: Fail
dummy_compiler_test: CompileTimeError
invalid_annotation2_test/none: RuntimeError
label_test/06: MissingCompileTimeError
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 940d901..c21b5b3 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -72,7 +72,6 @@
[ $compiler == dart2js && $dart2js_with_kernel && $checked ]
bound_closure_super_test: RuntimeError
-event_loop_test: RuntimeError
fake_thing_test: RuntimeError
mirror_intercepted_field_test: RuntimeError
native_library_same_name_used_frog_test: CompileTimeError
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index fd5a27d..6b3dab8 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -457,7 +457,6 @@
map_test: Crash # tests/corelib/map_test.dart:866:7: Internal problem: Unhandled Null in installDefaultConstructor.
nan_infinity_test/01: RuntimeError
regress_r21715_test: RuntimeError
-stacktrace_fromstring_test: RuntimeError
string_base_vm_test: RuntimeError
symbol_reserved_word_test/03: RuntimeError
symbol_reserved_word_test/04: MissingCompileTimeError
diff --git a/tests/corelib_2/corelib_2.status b/tests/corelib_2/corelib_2.status
index d7d93c6..6474974 100644
--- a/tests/corelib_2/corelib_2.status
+++ b/tests/corelib_2/corelib_2.status
@@ -537,7 +537,7 @@
iterable_empty_test: RuntimeError
iterable_fold_test/02: RuntimeError
iterable_mapping_test/none: RuntimeError
-iterable_reduce_test/01: RuntimeError
+iterable_reduce_test/01: CompileTimeError # Issue 31533
iterable_reduce_test/none: RuntimeError
iterable_to_list_test/01: RuntimeError
iterable_to_list_test/none: RuntimeError
@@ -554,7 +554,6 @@
string_trimlr_test/02: RuntimeError
symbol_operator_test/03: RuntimeError
symbol_reserved_word_test/04: MissingCompileTimeError
-symbol_reserved_word_test/05: MissingCompileTimeError
symbol_reserved_word_test/06: RuntimeError
symbol_reserved_word_test/07: MissingCompileTimeError
symbol_reserved_word_test/09: RuntimeError
@@ -573,7 +572,7 @@
int_modulo_arith_test/none: CompileTimeError # Issue 31402 (Assert statement)
iterable_fold_test/02: RuntimeError
iterable_generate_test/01: RuntimeError # Issue 31385 (--strong is not passed to the runtime)
-iterable_reduce_test/01: RuntimeError
+iterable_reduce_test/01: CompileTimeError # Issue 31533
iterable_reduce_test/none: RuntimeError
iterable_to_list_test/01: RuntimeError
iterable_to_list_test/none: RuntimeError
@@ -587,7 +586,6 @@
string_trimlr_test/02: RuntimeError
symbol_operator_test/03: RuntimeError
symbol_reserved_word_test/04: MissingCompileTimeError
-symbol_reserved_word_test/05: MissingCompileTimeError
symbol_reserved_word_test/06: RuntimeError
symbol_reserved_word_test/07: MissingCompileTimeError
symbol_reserved_word_test/09: RuntimeError
@@ -677,7 +675,6 @@
list_test/01: Crash # Unsupported operation: Unsupported type parameter type node T.
list_test/none: Crash # Unsupported operation: Unsupported type parameter type node T.
map_test: Crash # tests/corelib_2/map_test.dart:903:7: Internal problem: Unhandled Null in installDefaultConstructor.
-stacktrace_fromstring_test: RuntimeError
symbol_reserved_word_test/03: RuntimeError
symbol_reserved_word_test/04: MissingCompileTimeError
symbol_reserved_word_test/05: MissingCompileTimeError
diff --git a/tests/html/html.status b/tests/html/html.status
index cd1e0e4..9122f62 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -332,12 +332,9 @@
js_util_test/hasProperty: RuntimeError
[ $compiler == dart2js && $dart2js_with_kernel && $checked ]
-async_spawnuri_test: RuntimeError
-async_test: RuntimeError
canvasrenderingcontext2d_test/drawImage_image_element: Timeout
canvasrenderingcontext2d_test/drawImage_video_element: Timeout
canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Timeout
-cross_domain_iframe_test: RuntimeError
custom/attribute_changed_callback_test/fully_supported: RuntimeError
custom/attribute_changed_callback_test/unsupported_on_polyfill: RuntimeError
custom/document_register_type_extensions_test/construction: RuntimeError
@@ -366,7 +363,6 @@
element_animate_test/omit_timing: Timeout
element_test/click: RuntimeError
element_test/eventDelegation: RuntimeError
-event_customevent_test: RuntimeError
fileapi_test/directoryReader: RuntimeError
fileapi_test/fileEntry: RuntimeError
form_data_test/functional: Timeout
@@ -376,30 +372,25 @@
indexeddb_3_test: RuntimeError
indexeddb_4_test: RuntimeError
indexeddb_5_test: RuntimeError
-isolates_test: RuntimeError
js_test/JsObject.fromBrowserObject(): RuntimeError
js_test/JsObject.jsify(): RuntimeError
js_typed_interop_default_arg_test/explicit_argument: RuntimeError
js_typed_interop_test/static_method_tearoff_1: RuntimeError
js_util_test/js_util.jsify(): RuntimeError
-keyboard_event_test: RuntimeError
mirrors_js_typed_interop_test: RuntimeError
mutationobserver_test/childList: Timeout
postmessage_structured_test/iframe: RuntimeError
postmessage_structured_test/primitives: Timeout
postmessage_structured_test/typed_arrays: Timeout
-streams_test: RuntimeError
-transferables_test: RuntimeError
transition_event_test/functional: Timeout
websocket_test/websocket: RuntimeError
websql_test/functional: RuntimeError
-worker_api_test: RuntimeError
worker_test/functional: Timeout
xhr_cross_origin_test/functional: Timeout
-xhr_cross_origin_test/functional/functional: RuntimeError
xhr_test/headers: RuntimeError
xhr_test/json: Timeout
xhr_test/xhr: Timeout
+xhr_test/xhr_requestBlob/xhr_requestBlob: Pass
xhr_test/xhr_requestBlob: RuntimeError
[ $compiler == dart2js && $fast_startup ]
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index 2ae3004..a0b4bae 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -1303,39 +1303,14 @@
[ $compiler == dart2js && $dart2js_with_kernel && $checked ]
arithmetic_canonicalization_test: RuntimeError
+assertion_initializer_const_function_test/01: RuntimeError
assertion_initializer_test: CompileTimeError
assign_static_type_test/01: Fail
assign_static_type_test/02: MissingCompileTimeError
-async_await_syntax_test/a06a: RuntimeError
-async_await_syntax_test/b06a: RuntimeError
-async_await_syntax_test/c06a: RuntimeError
-async_await_syntax_test/d06a: RuntimeError
async_await_test: Crash # NoSuchMethodError: The method 'generateBreak' was called on null.
-async_return_types_test/none: RuntimeError
-async_return_types_test/tooManyTypeParameters: RuntimeError
-async_star_cancel_and_throw_in_finally_test: RuntimeError
+async_return_types_test/nestedFuture: Fail
+async_return_types_test/wrongTypeParameter: Fail
async_star_cancel_while_paused_test: RuntimeError
-async_star_no_cancel2_test: RuntimeError
-async_star_no_cancel_test: RuntimeError
-async_star_pause_test: RuntimeError
-async_star_regression_2238_test: RuntimeError
-async_star_regression_23116_test: RuntimeError
-async_star_regression_fisk_test: RuntimeError
-async_star_stream_take_test: RuntimeError
-async_star_take_reyield_test: RuntimeError
-async_star_test: RuntimeError
-async_test/setter1: Crash # 'file:*/pkg/compiler/lib/src/kernel/element_map_impl.dart': Failed assertion: line 939 pos 18: 'asyncMarker == AsyncMarker.SYNC': is not true.
-async_throw_in_catch_test/forceAwait: RuntimeError
-async_throw_in_catch_test/none: RuntimeError
-asyncstar_concat_test: RuntimeError
-asyncstar_throw_in_catch_test: RuntimeError
-asyncstar_yield_test: RuntimeError
-asyncstar_yieldstar_test: RuntimeError
-await_exceptions_test: RuntimeError
-await_for_cancel_test: RuntimeError
-await_for_test: RuntimeError
-await_for_use_local_test: RuntimeError
-await_not_started_immediately_test: RuntimeError
bad_constructor_test/06: Crash # NoSuchMethodError: The getter 'iterator' was called on null.
bad_override_test/03: MissingCompileTimeError
bad_override_test/04: MissingCompileTimeError
@@ -1346,7 +1321,6 @@
bit_operations_test/04: RuntimeError
bit_operations_test/none: RuntimeError
branch_canonicalization_test: RuntimeError
-branches_test: Crash # 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart': Failed assertion: line 437 pos 16: 'identical(combiner.arguments.positional[0], rhs)': is not true.
call_function_apply_test: RuntimeError
call_nonexistent_constructor_test/01: RuntimeError
canonical_const2_test: RuntimeError
@@ -1415,11 +1389,11 @@
constructor5_test: RuntimeError
constructor6_test: RuntimeError
constructor_named_arguments_test/none: RuntimeError
-constructor_redirect1_negative_test: Crash # Stack Overflow
-constructor_redirect2_negative_test: Crash # Stack Overflow
+constructor_redirect1_negative_test: Crash # Issue 30856
+constructor_redirect2_negative_test: Crash # Issue 30856
constructor_redirect2_test/01: MissingCompileTimeError
constructor_redirect_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(A.named2#x), local(A.named2#y), local(A.named2#z)) for j:constructor(A.named2).
-cyclic_constructor_test/01: Crash # Stack Overflow
+cyclic_constructor_test/01: Crash # Issue 30856
default_factory2_test/01: Fail
deferred_closurize_load_library_test: RuntimeError
deferred_constraints_constants_test/default_argument2: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
@@ -1438,7 +1412,6 @@
deferred_load_library_wrong_args_test/01: MissingRuntimeError
deferred_not_loaded_check_test: RuntimeError
deferred_redirecting_factory_test: RuntimeError
-deferred_shared_and_unshared_classes_test: RuntimeError
double_int_to_string_test: RuntimeError
duplicate_export_negative_test: Fail
duplicate_implements_test/01: MissingCompileTimeError
@@ -1675,7 +1648,6 @@
null_test/none: RuntimeError
number_identity2_test: RuntimeError
numbers_test: RuntimeError
-operator_test: Crash # 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart': Failed assertion: line 437 pos 16: 'identical(combiner.arguments.positional[0], rhs)': is not true.
override_field_method1_negative_test: Fail
override_field_method2_negative_test: Fail
override_field_method4_negative_test: Fail
@@ -1686,7 +1658,6 @@
override_inheritance_mixed_test/03: MissingCompileTimeError
override_inheritance_mixed_test/04: MissingCompileTimeError
override_method_with_field_test/01: MissingCompileTimeError
-prefix5_negative_test: Crash # 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart': Failed assertion: line 437 pos 16: 'identical(combiner.arguments.positional[0], rhs)': is not true.
private_super_constructor_test/01: MissingCompileTimeError
redirecting_constructor_initializer_test: RuntimeError
redirecting_factory_default_values_test/01: MissingCompileTimeError
@@ -1702,9 +1673,7 @@
regress_22976_test/01: CompileTimeError
regress_22976_test/02: CompileTimeError
regress_22976_test/none: CompileTimeError
-regress_23996_test: RuntimeError
regress_24283_test: RuntimeError
-regress_24935_test/none: RuntimeError
regress_26133_test: RuntimeError # Issue 26429
regress_27572_test: RuntimeError
regress_27617_test/1: Crash # Assertion failure: Unexpected constructor j:constructor(Foo._) in ConstructorDataImpl._getConstructorConstant
@@ -1726,8 +1695,6 @@
switch_case_test/00: MissingCompileTimeError
switch_case_test/01: MissingCompileTimeError
switch_case_test/02: MissingCompileTimeError
-sync_generator2_test/41: Crash # 'file:*/pkg/compiler/lib/src/kernel/element_map_impl.dart': Failed assertion: line 939 pos 18: 'asyncMarker == AsyncMarker.SYNC': is not true.
-sync_generator2_test/52: Crash # 'file:*/pkg/compiler/lib/src/kernel/element_map_impl.dart': Failed assertion: line 939 pos 18: 'asyncMarker == AsyncMarker.SYNC': is not true.
syntax_test/none: CompileTimeError
top_level_getter_no_setter1_test/01: RuntimeError
top_level_getter_no_setter2_test/01: RuntimeError
@@ -1751,5 +1718,4 @@
type_variable_bounds_test/04: Fail
type_variable_bounds_test/05: Fail
type_variable_scope_test/03: Crash # Internal Error: Unexpected type variable in static context.
-yieldstar_pause_test: RuntimeError
diff --git a/tests/language_2/async_await_foreign_test.dart b/tests/language_2/async_await_foreign_test.dart
index ed5f99e..2674f95 100644
--- a/tests/language_2/async_await_foreign_test.dart
+++ b/tests/language_2/async_await_foreign_test.dart
@@ -4,6 +4,7 @@
import 'dart:async';
import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
typedef Future<Null> Task();
@@ -65,8 +66,12 @@
return 'world';
}
-Future main() async {
- var r2 = await world();
- Expect.equals('hello', r1);
- Expect.equals('world', r2);
+void main() {
+ asyncStart();
+ () async {
+ var r2 = await world();
+ Expect.equals('hello', r1);
+ Expect.equals('world', r2);
+ asyncEnd();
+ }();
}
diff --git a/tests/language_2/async_call_test.dart b/tests/language_2/async_call_test.dart
index 3bddf87..a3643f9 100644
--- a/tests/language_2/async_call_test.dart
+++ b/tests/language_2/async_call_test.dart
@@ -4,6 +4,7 @@
import "dart:async";
import "package:expect/expect.dart";
+import "package:async_helper/async_helper.dart";
var result = "";
@@ -15,14 +16,18 @@
result += "bar";
}
-main() async {
- var f = new Future(foo);
- var b = bar();
- Expect.equals("", result);
- scheduleMicrotask(() => result += "micro");
- await b;
- await f;
+main() {
+ asyncStart();
+ () async {
+ var f = new Future(foo);
+ var b = bar();
+ Expect.equals("", result);
+ scheduleMicrotask(() => result += "micro");
+ await b;
+ await f;
- // Validates that bar is scheduled as a microtask, before foo.
- Expect.equals("barmicrofoo", result);
+ // Validates that bar is scheduled as a microtask, before foo.
+ Expect.equals("barmicrofoo", result);
+ asyncEnd();
+ }();
}
diff --git a/tests/language_2/cascaded_forwarding_stubs_generic_test.dart b/tests/language_2/cascaded_forwarding_stubs_generic_test.dart
new file mode 100644
index 0000000..9dc502b
--- /dev/null
+++ b/tests/language_2/cascaded_forwarding_stubs_generic_test.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+class A {}
+
+class B extends A {}
+
+class C {
+ void f(B x, B y) {}
+}
+
+abstract class I1<T> {
+ void f(T x, B y);
+}
+
+// D contains a forwarding stub for f which ensures that `x` is type checked.
+class D extends C implements I1<B> {}
+
+abstract class I2<T> {
+ void f(B x, T y);
+}
+
+// E contains a forwarding stub for f which ensures that `y` is type checked.
+class E extends D implements I2<B> {}
+
+main() {
+ E e = new E();
+ C c = e;
+ I1<A> i1 = e;
+ D d = e;
+ I2<A> i2 = e;
+ A a = new A();
+ B b = new B();
+ c.f(b, b); // No error
+ i1.f(b, b); // No error
+ d.f(b, b); // No error
+ i2.f(b, b); // No error
+ e.f(b, b); // No error
+ Expect.throwsTypeError(() {
+ i1.f(a, b);
+ });
+ Expect.throwsTypeError(() {
+ d.f(a, b);
+ });
+ Expect.throwsTypeError(() {
+ i2.f(b, a);
+ });
+ Expect.throwsTypeError(() {
+ e.f(a, b);
+ });
+ Expect.throwsTypeError(() {
+ e.f(b, a);
+ });
+}
diff --git a/tests/language_2/cascaded_forwarding_stubs_test.dart b/tests/language_2/cascaded_forwarding_stubs_test.dart
new file mode 100644
index 0000000..1af182b
--- /dev/null
+++ b/tests/language_2/cascaded_forwarding_stubs_test.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+class A {}
+
+class B extends A {}
+
+class C {
+ void f(B x, B y) {}
+}
+
+abstract class I1 {
+ void f(covariant A x, B y);
+}
+
+// D contains a forwarding stub for f which ensures that `x` is type checked.
+class D extends C implements I1 {}
+
+abstract class I2 {
+ void f(B x, covariant A y);
+}
+
+// E contains a forwarding stub for f which ensures that `y` is type checked.
+class E extends D implements I2 {}
+
+main() {
+ E e = new E();
+ C c = e;
+ I1 i1 = e;
+ D d = e;
+ I2 i2 = e;
+ A a = new A();
+ B b = new B();
+ c.f(b, b); // No error
+ i1.f(b, b); // No error
+ d.f(b, b); // No error
+ i2.f(b, b); // No error
+ e.f(b, b); // No error
+ Expect.throwsTypeError(() {
+ i1.f(a, b);
+ });
+ Expect.throwsTypeError(() {
+ d.f(a, b);
+ });
+ Expect.throwsTypeError(() {
+ i2.f(b, a);
+ });
+ Expect.throwsTypeError(() {
+ e.f(a, b);
+ });
+ Expect.throwsTypeError(() {
+ e.f(b, a);
+ });
+}
diff --git a/tests/language_2/checked_method_error_order_test.dart b/tests/language_2/checked_method_error_order_test.dart
new file mode 100644
index 0000000..508a957
--- /dev/null
+++ b/tests/language_2/checked_method_error_order_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+import "package:expect/expect.dart";
+
+class Bar {
+ foo({int i, String a}) {
+ print(i);
+ print(a);
+ }
+}
+
+main() {
+ bool checkedMode = false;
+ assert((checkedMode = true));
+ // Test that in checked mode, we are checking the type of optional parameters
+ // in the correct order (aka, don't check the type of parameter 'a' first).
+ if (checkedMode) {
+ dynamic x = 'e';
+ dynamic y = 3;
+ Expect.throws(
+ () => new Bar().foo(i: x, a: y),
+ (e) =>
+ e is TypeError &&
+ e.message.toString().contains("is not a subtype of type 'int'"));
+ }
+}
diff --git a/tests/language_2/language_2_analyzer.status b/tests/language_2/language_2_analyzer.status
index b720cd2..afb8c7e 100644
--- a/tests/language_2/language_2_analyzer.status
+++ b/tests/language_2/language_2_analyzer.status
@@ -477,6 +477,9 @@
constructor13_test/02: MissingCompileTimeError
int64_literal_test/03: MissingCompileTimeError
int64_literal_test/30: MissingCompileTimeError
+object_has_no_call_method_test/02: MissingCompileTimeError
+object_has_no_call_method_test/05: MissingCompileTimeError
+object_has_no_call_method_test/08: MissingCompileTimeError
[ $compiler == dart2analyzer && $checked ]
assertion_initializer_const_error2_test/none: Pass
@@ -1036,6 +1039,7 @@
accessor_conflict_import_test: CompileTimeError # Issue 25626
additional_interface_adds_optional_args_test: CompileTimeError # Issue #30568
async_return_types_test/nestedFuture: MissingCompileTimeError
+cascaded_forwarding_stubs_test: CompileTimeError
combiner_type_lookup_indexed_test: CompileTimeError # Issue #31484
combiner_type_lookup_instance_test: CompileTimeError # Issue #31484
combiner_type_lookup_static_test: CompileTimeError # Issue #31484
@@ -1071,6 +1075,7 @@
multiline_newline_test/05: MissingCompileTimeError
multiline_newline_test/05r: MissingCompileTimeError
multiple_interface_inheritance_test: CompileTimeError # Issue 30552
+object_has_no_call_method_test/02: MissingCompileTimeError
override_inheritance_abstract_test/02: MissingCompileTimeError
override_inheritance_abstract_test/03: MissingCompileTimeError
override_inheritance_abstract_test/04: MissingCompileTimeError
diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status
index 4341b0c..08cc5c2 100644
--- a/tests/language_2/language_2_dart2js.status
+++ b/tests/language_2/language_2_dart2js.status
@@ -975,6 +975,9 @@
full_stacktrace1_test: Pass, RuntimeError # Issue 12698
full_stacktrace2_test: Pass, RuntimeError # Issue 12698
nan_identical_test: Fail # Issue 11551
+object_has_no_call_method_test/02: MissingCompileTimeError
+object_has_no_call_method_test/05: MissingCompileTimeError
+object_has_no_call_method_test/08: MissingCompileTimeError
positional_parameters_type_test/01: MissingCompileTimeError
positional_parameters_type_test/02: MissingCompileTimeError
stacktrace_test: Pass, RuntimeError # # Issue 12698
@@ -1011,6 +1014,8 @@
[ $compiler == dart2js && $runtime != none && !$checked && !$dart2js_with_kernel ]
callable_test/none: RuntimeError
+cascaded_forwarding_stubs_generic_test: RuntimeError
+cascaded_forwarding_stubs_test: RuntimeError
checked_setter_test: RuntimeError
checked_setter2_test: RuntimeError
checked_setter3_test: RuntimeError
@@ -2065,7 +2070,7 @@
tearoff_dynamic_test: Crash # Unsupported operation: Unsupported type parameter type node T.
truncdiv_test: RuntimeError
try_catch_test/01: MissingCompileTimeError
-type_literal_test: Crash # NoSuchMethodError: The getter 'enclosingLibrary' was called on null.
+type_literal_test: RuntimeError
typevariable_substitution2_test/02: RuntimeError
[ $compiler == dart2js && $dart2js_with_kernel && $fast_startup ]
@@ -2488,49 +2493,16 @@
tearoff_dynamic_test: Crash # Unsupported operation: Unsupported type parameter type node T.
truncdiv_test: RuntimeError
try_catch_test/01: MissingCompileTimeError
-type_literal_test: Crash # NoSuchMethodError: The getter 'enclosingLibrary' was called on null.
+type_literal_test: RuntimeError
typevariable_substitution2_test/02: RuntimeError
[ $compiler == dart2js && $dart2js_with_kernel && $checked ]
arithmetic_canonicalization_test: RuntimeError
+assertion_initializer_const_function_test/01: MissingCompileTimeError
assertion_initializer_test: CompileTimeError
assertion_test: RuntimeError
-async_await_syntax_test/a06a: RuntimeError
-async_await_syntax_test/b06a: RuntimeError
-async_await_syntax_test/c06a: RuntimeError
-async_await_syntax_test/d06a: RuntimeError
-async_await_test/02: RuntimeError
-async_await_test/03: RuntimeError
-async_await_test/none: RuntimeError
-async_return_types_test/none: RuntimeError
-async_star_await_pauses_test: RuntimeError
-async_star_cancel_and_throw_in_finally_test: RuntimeError
async_star_cancel_while_paused_test: RuntimeError
-async_star_no_cancel2_test: RuntimeError
-async_star_no_cancel_test: RuntimeError
-async_star_pause_test: RuntimeError
-async_star_regression_2238_test: RuntimeError
-async_star_regression_23116_test: RuntimeError
-async_star_regression_fisk_test: RuntimeError
-async_star_stream_take_test: RuntimeError
-async_star_take_reyield_test: RuntimeError
-async_star_test/01: RuntimeError
async_star_test/02: RuntimeError
-async_star_test/03: RuntimeError
-async_star_test/04: RuntimeError
-async_star_test/05: RuntimeError
-async_star_test/none: RuntimeError
-async_throw_in_catch_test/forceAwait: RuntimeError
-async_throw_in_catch_test/none: RuntimeError
-asyncstar_concat_test: RuntimeError
-asyncstar_throw_in_catch_test: RuntimeError
-asyncstar_yield_test: RuntimeError
-asyncstar_yieldstar_test: RuntimeError
-await_exceptions_test: RuntimeError
-await_for_cancel_test: RuntimeError
-await_for_test: RuntimeError
-await_for_use_local_test: RuntimeError
-await_not_started_immediately_test: RuntimeError
bad_override_test/03: MissingCompileTimeError
bad_override_test/04: MissingCompileTimeError
bad_override_test/05: MissingCompileTimeError
@@ -2538,7 +2510,6 @@
bit_operations_test/04: RuntimeError
bit_operations_test/none: RuntimeError
branch_canonicalization_test: RuntimeError
-branches_test: Crash # 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart': Failed assertion: line 437 pos 16: 'identical(combiner.arguments.positional[0], rhs)': is not true.
call_function_apply_test: RuntimeError
canonical_const2_test: RuntimeError
check_member_static_test/02: MissingCompileTimeError
@@ -2670,7 +2641,6 @@
deferred_load_library_wrong_args_test/01: MissingRuntimeError
deferred_not_loaded_check_test: RuntimeError
deferred_redirecting_factory_test: RuntimeError
-deferred_shared_and_unshared_classes_test: RuntimeError
double_int_to_string_test: RuntimeError
duplicate_export_negative_test: Fail
duplicate_implements_test/01: MissingCompileTimeError
@@ -2695,7 +2665,6 @@
final_attempt_reinitialization_test/02: MissingCompileTimeError
function_type_alias_test: RuntimeError
generalized_void_syntax_test: CompileTimeError
-generic_async_star_test: RuntimeError
generic_closure_test/01: RuntimeError
generic_closure_test/none: RuntimeError
generic_field_mixin4_test: Crash # Assertion failure: Runtime type information not available for type_variable_local(M.T) in () for j:constructor(C3.).
@@ -2715,7 +2684,7 @@
getter_override_test/01: MissingCompileTimeError
getter_override_test/02: MissingCompileTimeError
identical_closure2_test: RuntimeError
-implicit_downcast_during_assert_initializer_test: Crash # 'file:*/pkg/compiler/lib/src/ssa/builder_kernel.dart': Failed assertion: line 660 pos 16: 'false': Unhandled initializer ir.ShadowAssertInitializer
+implicit_downcast_during_assert_initializer_test: RuntimeError
infinite_switch_label_test: Crash # NoSuchMethodError: The method 'generateBreak' was called on null.
infinity_test: RuntimeError
instance_creation_in_function_annotation_test: RuntimeError
@@ -2854,7 +2823,6 @@
null_test/none: RuntimeError
number_identity2_test: RuntimeError
numbers_test: RuntimeError
-operator_test: Crash # 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart': Failed assertion: line 437 pos 16: 'identical(combiner.arguments.positional[0], rhs)': is not true.
override_field_method1_negative_test: Fail
override_field_method2_negative_test: Fail
override_field_method4_negative_test: Fail
@@ -2869,7 +2837,6 @@
override_method_with_field_test/01: MissingCompileTimeError
positional_parameters_type_test/01: MissingCompileTimeError
positional_parameters_type_test/02: MissingCompileTimeError
-prefix5_negative_test: Crash # 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart': Failed assertion: line 437 pos 16: 'identical(combiner.arguments.positional[0], rhs)': is not true.
private_super_constructor_test/01: MissingCompileTimeError
redirecting_factory_default_values_test/01: MissingCompileTimeError
redirecting_factory_default_values_test/02: MissingCompileTimeError
@@ -2879,9 +2846,7 @@
regress_22976_test/01: CompileTimeError
regress_22976_test/02: CompileTimeError
regress_22976_test/none: CompileTimeError
-regress_23996_test: RuntimeError
regress_24283_test: RuntimeError
-regress_24935_test/none: RuntimeError
regress_27617_test/1: Crash # Assertion failure: Unexpected constructor j:constructor(Foo._) in ConstructorDataImpl._getConstructorConstant
regress_28217_test/01: MissingCompileTimeError
regress_28217_test/none: MissingCompileTimeError
@@ -2894,7 +2859,6 @@
regress_31057_test: Crash # Unsupported operation: Unsupported type parameter type node B.
setter_override_test/00: MissingCompileTimeError
setter_override_test/03: MissingCompileTimeError
-shadow_parameter_and_local_test: RuntimeError
stacktrace_demangle_ctors_test: RuntimeError
stacktrace_test: RuntimeError
super_call4_test: Crash # NoSuchMethodError: The getter 'thisLocal' was called on null.
@@ -2904,8 +2868,6 @@
switch_case_test/01: MissingCompileTimeError
switch_case_test/02: MissingCompileTimeError
symbol_literal_test/01: MissingCompileTimeError
-sync_generator2_test/41: Crash # 'file:*/pkg/compiler/lib/src/kernel/element_map_impl.dart': Failed assertion: line 939 pos 18: 'asyncMarker == AsyncMarker.SYNC': is not true.
-sync_generator2_test/52: Crash # 'file:*/pkg/compiler/lib/src/kernel/element_map_impl.dart': Failed assertion: line 939 pos 18: 'asyncMarker == AsyncMarker.SYNC': is not true.
syntax_test/28: MissingCompileTimeError
syntax_test/29: MissingCompileTimeError
syntax_test/30: MissingCompileTimeError
@@ -2916,11 +2878,10 @@
truncdiv_test: RuntimeError
try_catch_test/01: MissingCompileTimeError
type_check_const_function_typedef2_test: MissingCompileTimeError
-type_literal_test: Crash # NoSuchMethodError: The getter 'enclosingLibrary' was called on null.
+type_literal_test: RuntimeError
type_parameter_test/06: Crash # Internal Error: Unexpected type variable in static context.
type_parameter_test/09: Crash # Internal Error: Unexpected type variable in static context.
type_variable_scope_test/03: Crash # Internal Error: Unexpected type variable in static context.
-yieldstar_pause_test: RuntimeError
[ $compiler == dart2js && $dart2js_with_kernel ]
checked_setter_test: RuntimeError # Issue 31128
@@ -2954,10 +2915,15 @@
implicit_downcast_during_super_initializer_test: RuntimeError
implicit_downcast_during_yield_star_test: RuntimeError
implicit_downcast_during_yield_test: RuntimeError
+object_has_no_call_method_test/02: MissingCompileTimeError
+object_has_no_call_method_test/05: MissingCompileTimeError
+object_has_no_call_method_test/08: MissingCompileTimeError
[ $compiler == dart2js && $dart2js_with_kernel && !$checked ]
assertion_initializer_const_error2_test/none: Pass
assertion_initializer_const_error2_test/*: CompileTimeError # Issue #31321
+cascaded_forwarding_stubs_generic_test: RuntimeError
+cascaded_forwarding_stubs_test: RuntimeError
checked_setter3_test: RuntimeError # Issue 31128
implicit_downcast_during_assignment_test: RuntimeError
implicit_downcast_during_combiner_test: RuntimeError
diff --git a/tests/language_2/language_2_dartdevc.status b/tests/language_2/language_2_dartdevc.status
index 4d5a070..5830537 100644
--- a/tests/language_2/language_2_dartdevc.status
+++ b/tests/language_2/language_2_dartdevc.status
@@ -12,6 +12,10 @@
unhandled_exception_negative_test: Fail
closure_call_wrong_argument_count_negative_test: Fail
+# Skip Kernel tests on Windows until bot has been fixed (Issue 31539)
+[ $compiler == dartdevk && $system == windows ]
+*: Skip
+
[ ($compiler == dartdevc && $runtime == none) || $compiler == dartdevk ]
instantiate_type_variable_test/01: CompileTimeError
setter_no_getter_call_test/01: CompileTimeError
@@ -120,6 +124,8 @@
black_listed_test/none: fail # Issue 14228
built_in_identifier_prefix_test: CompileTimeError
built_in_identifier_type_annotation_test/22: MissingCompileTimeError # Issue 28816
+cascaded_forwarding_stubs_generic_test: RuntimeError
+cascaded_forwarding_stubs_test: CompileTimeError
combiner_type_lookup_indexed_test: CompileTimeError # Issue #31484
combiner_type_lookup_instance_test: CompileTimeError # Issue #31484
combiner_type_lookup_static_test: CompileTimeError # Issue #31484
@@ -173,6 +179,7 @@
multiline_newline_test/02r: CompileTimeError
multiple_interface_inheritance_test: CompileTimeError # Issue 30552
nested_generic_closure_test: CompileTimeError
+object_has_no_call_method_test/02: MissingCompileTimeError
override_inheritance_field_test/04: CompileTimeError
override_inheritance_field_test/06: CompileTimeError
override_inheritance_field_test/26: CompileTimeError
@@ -282,51 +289,12 @@
call_function2_test: CompileTimeError # Issue 31402; Error: A value of type '#lib1::Bar' can't be assigned to a variable of type '(dart.core::Object) → dart.core::Object'.
call_non_method_field_test/01: MissingCompileTimeError
call_non_method_field_test/02: MissingCompileTimeError
-call_through_getter_test/01: MissingCompileTimeError
-call_through_getter_test/02: MissingCompileTimeError
-call_type_literal_test/01: MissingCompileTimeError
call_with_no_such_method_test: CompileTimeError # Issue 31402 Error: A value of type '#lib1::F' can't be assigned to a variable of type 'dart.core::Function'.
callable_test/none: CompileTimeError
-cast_test/04: MissingCompileTimeError
-cast_test/05: MissingCompileTimeError
check_member_static_test/01: MissingCompileTimeError
check_member_static_test/02: MissingCompileTimeError
-checked_null_test/01: MissingCompileTimeError
class_cycle_test/02: MissingCompileTimeError
class_cycle_test/03: MissingCompileTimeError
-class_literal_static_test/01: MissingCompileTimeError
-class_literal_static_test/02: MissingCompileTimeError
-class_literal_static_test/03: MissingCompileTimeError
-class_literal_static_test/04: MissingCompileTimeError
-class_literal_static_test/05: MissingCompileTimeError
-class_literal_static_test/06: MissingCompileTimeError
-class_literal_static_test/07: MissingCompileTimeError
-class_literal_static_test/08: MissingCompileTimeError
-class_literal_static_test/09: MissingCompileTimeError
-class_literal_static_test/10: MissingCompileTimeError
-class_literal_static_test/11: MissingCompileTimeError
-class_literal_static_test/14: MissingCompileTimeError
-class_literal_static_test/15: MissingCompileTimeError
-class_literal_static_test/16: MissingCompileTimeError
-class_literal_static_test/23: MissingCompileTimeError
-class_literal_test/01: MissingCompileTimeError
-class_literal_test/02: MissingCompileTimeError
-class_literal_test/03: MissingCompileTimeError
-class_literal_test/04: MissingCompileTimeError
-class_literal_test/05: MissingCompileTimeError
-class_literal_test/06: MissingCompileTimeError
-class_literal_test/07: MissingCompileTimeError
-class_literal_test/08: MissingCompileTimeError
-class_literal_test/09: MissingCompileTimeError
-class_literal_test/10: MissingCompileTimeError
-class_literal_test/11: MissingCompileTimeError
-class_literal_test/14: MissingCompileTimeError
-class_literal_test/15: MissingCompileTimeError
-class_literal_test/16: MissingCompileTimeError
-class_literal_test/23: MissingCompileTimeError
-closure_internals_test/01: MissingCompileTimeError
-closure_internals_test/02: MissingCompileTimeError
-closure_internals_test/03: MissingCompileTimeError
closure_invoked_through_interface_target_field_test: MissingCompileTimeError
closure_invoked_through_interface_target_getter_test: MissingCompileTimeError
compile_time_constant_c_test/02: MissingCompileTimeError
@@ -343,13 +311,6 @@
compile_time_constant_static5_test/03: MissingCompileTimeError
compile_time_constant_static5_test/13: MissingCompileTimeError
compile_time_constant_static5_test/18: MissingCompileTimeError
-conditional_method_invocation_test/07: MissingCompileTimeError
-conditional_property_access_test/05: MissingCompileTimeError
-conditional_property_access_test/06: MissingCompileTimeError
-conditional_property_assignment_test/05: MissingCompileTimeError
-conditional_property_assignment_test/06: MissingCompileTimeError
-conditional_property_assignment_test/10: MissingCompileTimeError
-conditional_property_assignment_test/11: MissingCompileTimeError
config_import_test: CompileTimeError
const_constructor2_test/20: MissingCompileTimeError
const_constructor2_test/22: MissingCompileTimeError
@@ -377,7 +338,6 @@
const_types_test/39: MissingCompileTimeError
const_types_test/40: MissingCompileTimeError
constants_test/05: MissingCompileTimeError
-constructor_call_as_function_test/01: MissingCompileTimeError
constructor_duplicate_final_test/01: Crash
constructor_duplicate_final_test/02: Crash
constructor_duplicate_final_test/03: Crash
@@ -423,7 +383,7 @@
duplicate_implements_test/02: MissingCompileTimeError
dynamic_prefix_core_test/none: CompileTimeError
dynamic_test: CompileTimeError
-error_stacktrace_test/00: MissingCompileTimeError
+emit_const_fields_test: CompileTimeError # Issue 31533
export_ambiguous_main_test: MissingCompileTimeError
external_test/21: CompileTimeError
external_test/24: CompileTimeError
@@ -447,12 +407,6 @@
final_attempt_reinitialization_test/01: Crash
final_attempt_reinitialization_test/02: Crash
final_syntax_test/09: Crash
-first_class_types_literals_test/05: MissingCompileTimeError
-first_class_types_literals_test/06: MissingCompileTimeError
-first_class_types_literals_test/07: MissingCompileTimeError
-first_class_types_literals_test/10: MissingCompileTimeError
-first_class_types_literals_test/11: MissingCompileTimeError
-first_class_types_literals_test/12: MissingCompileTimeError
function_propagation_test: CompileTimeError
function_subtype_bound_closure7_test: CompileTimeError
function_type_parameter2_negative_test: Fail
@@ -532,34 +486,16 @@
generic_methods_tearoff_specialization_test: CompileTimeError
generic_methods_unused_parameter_test: CompileTimeError
generic_no_such_method_dispatcher_simple_test: CompileTimeError # Warning: Superclass has no method named 'foo'.
+generic_no_such_method_dispatcher_test: CompileTimeError # Issue 31533
getter_override2_test/02: MissingCompileTimeError
getter_override_test/00: MissingCompileTimeError
getter_override_test/01: MissingCompileTimeError
getter_override_test/02: MissingCompileTimeError
getter_override_test/03: MissingCompileTimeError
-getters_setters2_test/02: MissingCompileTimeError
identical_const_test/01: MissingCompileTimeError
identical_const_test/02: MissingCompileTimeError
identical_const_test/03: MissingCompileTimeError
identical_const_test/04: MissingCompileTimeError
-if_null_assignment_static_test/02: MissingCompileTimeError
-if_null_assignment_static_test/04: MissingCompileTimeError
-if_null_assignment_static_test/06: MissingCompileTimeError
-if_null_assignment_static_test/09: MissingCompileTimeError
-if_null_assignment_static_test/11: MissingCompileTimeError
-if_null_assignment_static_test/13: MissingCompileTimeError
-if_null_assignment_static_test/16: MissingCompileTimeError
-if_null_assignment_static_test/18: MissingCompileTimeError
-if_null_assignment_static_test/20: MissingCompileTimeError
-if_null_assignment_static_test/23: MissingCompileTimeError
-if_null_assignment_static_test/25: MissingCompileTimeError
-if_null_assignment_static_test/27: MissingCompileTimeError
-if_null_assignment_static_test/30: MissingCompileTimeError
-if_null_assignment_static_test/32: MissingCompileTimeError
-if_null_assignment_static_test/34: MissingCompileTimeError
-if_null_assignment_static_test/37: MissingCompileTimeError
-if_null_assignment_static_test/39: MissingCompileTimeError
-if_null_assignment_static_test/41: MissingCompileTimeError
implicit_this_test/01: MissingCompileTimeError
implicit_this_test/04: MissingCompileTimeError
initializing_formal_type_annotation_test/01: MissingCompileTimeError
@@ -569,29 +505,8 @@
issue18628_2_test/01: MissingCompileTimeError
issue_25671a_test/01: CompileTimeError # Warning: The method 'A::noSuchMethod' has fewer positional arguments than those of overridden method 'Object::noSuchMethod'.
issue_25671b_test/01: CompileTimeError # Warning: The method 'A::noSuchMethod' has fewer positional arguments than those of overridden method 'Object::noSuchMethod'.
-least_upper_bound_expansive_test/01: MissingCompileTimeError
-least_upper_bound_expansive_test/02: MissingCompileTimeError
-least_upper_bound_expansive_test/03: MissingCompileTimeError
-least_upper_bound_expansive_test/04: MissingCompileTimeError
-least_upper_bound_expansive_test/05: MissingCompileTimeError
-least_upper_bound_expansive_test/06: MissingCompileTimeError
-least_upper_bound_expansive_test/07: MissingCompileTimeError
-least_upper_bound_expansive_test/08: MissingCompileTimeError
-least_upper_bound_expansive_test/09: MissingCompileTimeError
-least_upper_bound_expansive_test/10: MissingCompileTimeError
-least_upper_bound_expansive_test/11: MissingCompileTimeError
-least_upper_bound_expansive_test/12: MissingCompileTimeError
-least_upper_bound_test/03: MissingCompileTimeError
-least_upper_bound_test/04: MissingCompileTimeError
-least_upper_bound_test/10: MissingCompileTimeError
-least_upper_bound_test/19: MissingCompileTimeError
-least_upper_bound_test/20: MissingCompileTimeError
-least_upper_bound_test/32: MissingCompileTimeError
-local_function3_test/01: MissingCompileTimeError
local_function_test/01: MissingCompileTimeError
local_function_test/02: MissingCompileTimeError
-local_function_test/03: MissingCompileTimeError
-logical_expression3_test: MissingCompileTimeError
malbounded_instantiation_test/01: MissingCompileTimeError
malbounded_instantiation_test/02: MissingCompileTimeError
malbounded_instantiation_test/03: MissingCompileTimeError
@@ -608,7 +523,6 @@
malbounded_type_test_test/00: MissingCompileTimeError
malbounded_type_test_test/01: MissingCompileTimeError
malbounded_type_test_test/02: MissingCompileTimeError
-malformed_bound_test/01: MissingCompileTimeError
map_literal3_test/01: MissingCompileTimeError
map_literal3_test/02: MissingCompileTimeError
map_literal3_test/03: MissingCompileTimeError
@@ -740,11 +654,9 @@
named_parameters_test/08: MissingCompileTimeError
named_parameters_test/10: MissingCompileTimeError
named_parameters_type_test/01: MissingCompileTimeError
+null_no_such_method_test: CompileTimeError # Issue 31533
null_test/02: MissingCompileTimeError
null_test/03: MissingCompileTimeError
-number_identifier_test/05: MissingCompileTimeError
-number_identifier_test/08: MissingCompileTimeError
-number_identifier_test/09: MissingCompileTimeError
optional_named_parameters_test/02: MissingCompileTimeError
optional_named_parameters_test/04: MissingCompileTimeError
optional_named_parameters_test/06: MissingCompileTimeError
@@ -802,7 +714,6 @@
override_inheritance_no_such_method_test/10: MissingCompileTimeError
override_inheritance_no_such_method_test/12: MissingCompileTimeError
override_method_with_field_test/01: MissingCompileTimeError
-override_method_with_field_test/02: MissingCompileTimeError
positional_parameters_type_test/01: MissingCompileTimeError
positional_parameters_type_test/02: MissingCompileTimeError
redirecting_factory_default_values_test/01: MissingCompileTimeError
@@ -812,6 +723,7 @@
redirecting_factory_malbounded_test/01: MissingCompileTimeError
regress_22976_test/01: CompileTimeError
regress_23089_test: MissingCompileTimeError
+regress_23408_test: CompileTimeError # Issue 31533
regress_25550_test: CompileTimeError
regress_29025_test: CompileTimeError
regress_29405_test: CompileTimeError # Issue 31402 Error: A value of type '#lib2::Foo' can't be assigned to a variable of type '(#lib2::Foo) → void'.
@@ -824,31 +736,8 @@
setter_override_test/01: MissingCompileTimeError
setter_override_test/02: MissingCompileTimeError
setter_override_test/03: MissingCompileTimeError
-static_field1_test/01: MissingCompileTimeError
-static_field1a_test/01: MissingCompileTimeError
-static_field_test/01: MissingCompileTimeError
-static_field_test/02: MissingCompileTimeError
-static_field_test/03: MissingCompileTimeError
-static_field_test/04: MissingCompileTimeError
-string_interpolation_test/01: MissingCompileTimeError
-string_no_operator_test/01: MissingCompileTimeError
-string_no_operator_test/02: MissingCompileTimeError
-string_no_operator_test/03: MissingCompileTimeError
-string_no_operator_test/04: MissingCompileTimeError
-string_no_operator_test/05: MissingCompileTimeError
-string_no_operator_test/07: MissingCompileTimeError
-string_no_operator_test/08: MissingCompileTimeError
-string_no_operator_test/09: MissingCompileTimeError
-string_no_operator_test/10: MissingCompileTimeError
-string_no_operator_test/11: MissingCompileTimeError
-string_no_operator_test/12: MissingCompileTimeError
-string_no_operator_test/13: MissingCompileTimeError
-string_no_operator_test/14: MissingCompileTimeError
-string_no_operator_test/15: MissingCompileTimeError
-string_no_operator_test/16: MissingCompileTimeError
-string_test/01: MissingCompileTimeError
-super_assign_test/01: MissingCompileTimeError
-super_bound_closure_test/01: MissingCompileTimeError
+string_interpolate_test: CompileTimeError # Issue 31533
+super_bound_closure_test/none: CompileTimeError # Issue 31533
super_call4_test: CompileTimeError
super_from_constructor_test: Crash
super_getter_setter_test: CompileTimeError
@@ -870,7 +759,6 @@
switch_case_test/00: MissingCompileTimeError
switch_case_test/01: MissingCompileTimeError
switch_case_test/02: MissingCompileTimeError
-symbol_literal_test/01: MissingCompileTimeError
syntax_test/28: MissingCompileTimeError
syntax_test/29: MissingCompileTimeError
syntax_test/30: MissingCompileTimeError
@@ -878,148 +766,8 @@
syntax_test/32: MissingCompileTimeError
syntax_test/33: MissingCompileTimeError
try_catch_test/01: MissingCompileTimeError
-type_literal_prefix_call_test/00: MissingCompileTimeError
-type_promotion_assign_test/01: MissingCompileTimeError
-type_promotion_assign_test/02: MissingCompileTimeError
-type_promotion_assign_test/03: MissingCompileTimeError
-type_promotion_assign_test/04: MissingCompileTimeError
-type_promotion_closure_test/01: MissingCompileTimeError
-type_promotion_closure_test/02: MissingCompileTimeError
-type_promotion_closure_test/03: MissingCompileTimeError
-type_promotion_closure_test/04: MissingCompileTimeError
-type_promotion_closure_test/06: MissingCompileTimeError
-type_promotion_closure_test/07: MissingCompileTimeError
-type_promotion_closure_test/09: MissingCompileTimeError
-type_promotion_closure_test/10: MissingCompileTimeError
-type_promotion_closure_test/11: MissingCompileTimeError
-type_promotion_closure_test/12: MissingCompileTimeError
-type_promotion_closure_test/13: MissingCompileTimeError
-type_promotion_closure_test/14: MissingCompileTimeError
-type_promotion_closure_test/15: MissingCompileTimeError
-type_promotion_closure_test/16: MissingCompileTimeError
-type_promotion_local_test/01: MissingCompileTimeError
-type_promotion_local_test/02: MissingCompileTimeError
-type_promotion_local_test/03: MissingCompileTimeError
-type_promotion_local_test/04: MissingCompileTimeError
-type_promotion_local_test/05: MissingCompileTimeError
-type_promotion_local_test/06: MissingCompileTimeError
-type_promotion_local_test/07: MissingCompileTimeError
-type_promotion_local_test/08: MissingCompileTimeError
-type_promotion_local_test/09: MissingCompileTimeError
-type_promotion_local_test/10: MissingCompileTimeError
-type_promotion_local_test/11: MissingCompileTimeError
-type_promotion_local_test/12: MissingCompileTimeError
-type_promotion_local_test/13: MissingCompileTimeError
-type_promotion_local_test/14: MissingCompileTimeError
-type_promotion_local_test/15: MissingCompileTimeError
-type_promotion_local_test/16: MissingCompileTimeError
-type_promotion_local_test/17: MissingCompileTimeError
-type_promotion_local_test/18: MissingCompileTimeError
-type_promotion_local_test/19: MissingCompileTimeError
-type_promotion_local_test/20: MissingCompileTimeError
-type_promotion_local_test/21: MissingCompileTimeError
-type_promotion_local_test/22: MissingCompileTimeError
-type_promotion_local_test/23: MissingCompileTimeError
-type_promotion_local_test/24: MissingCompileTimeError
-type_promotion_local_test/25: MissingCompileTimeError
-type_promotion_local_test/26: MissingCompileTimeError
-type_promotion_local_test/27: MissingCompileTimeError
-type_promotion_local_test/28: MissingCompileTimeError
-type_promotion_local_test/29: MissingCompileTimeError
-type_promotion_local_test/30: MissingCompileTimeError
-type_promotion_local_test/31: MissingCompileTimeError
-type_promotion_local_test/32: MissingCompileTimeError
-type_promotion_local_test/33: MissingCompileTimeError
-type_promotion_local_test/34: MissingCompileTimeError
-type_promotion_local_test/35: MissingCompileTimeError
-type_promotion_local_test/36: MissingCompileTimeError
-type_promotion_local_test/37: MissingCompileTimeError
-type_promotion_local_test/38: MissingCompileTimeError
-type_promotion_local_test/39: MissingCompileTimeError
-type_promotion_local_test/40: MissingCompileTimeError
-type_promotion_local_test/41: MissingCompileTimeError
type_promotion_logical_and_test/01: MissingCompileTimeError
-type_promotion_logical_and_test/02: MissingCompileTimeError
-type_promotion_logical_and_test/03: MissingCompileTimeError
-type_promotion_more_specific_test/02: MissingCompileTimeError
-type_promotion_more_specific_test/09: MissingCompileTimeError
-type_promotion_multiple_test/01: MissingCompileTimeError
-type_promotion_multiple_test/02: MissingCompileTimeError
-type_promotion_multiple_test/03: MissingCompileTimeError
-type_promotion_multiple_test/04: MissingCompileTimeError
-type_promotion_multiple_test/05: MissingCompileTimeError
-type_promotion_multiple_test/06: MissingCompileTimeError
-type_promotion_multiple_test/07: MissingCompileTimeError
-type_promotion_multiple_test/08: MissingCompileTimeError
-type_promotion_multiple_test/09: MissingCompileTimeError
-type_promotion_multiple_test/10: MissingCompileTimeError
-type_promotion_multiple_test/11: MissingCompileTimeError
-type_promotion_multiple_test/12: MissingCompileTimeError
-type_promotion_multiple_test/13: MissingCompileTimeError
-type_promotion_multiple_test/14: MissingCompileTimeError
-type_promotion_multiple_test/15: MissingCompileTimeError
-type_promotion_multiple_test/16: MissingCompileTimeError
-type_promotion_multiple_test/17: MissingCompileTimeError
-type_promotion_multiple_test/18: MissingCompileTimeError
-type_promotion_multiple_test/19: MissingCompileTimeError
-type_promotion_multiple_test/20: MissingCompileTimeError
-type_promotion_multiple_test/21: MissingCompileTimeError
-type_promotion_multiple_test/22: MissingCompileTimeError
-type_promotion_parameter_test/01: MissingCompileTimeError
-type_promotion_parameter_test/02: MissingCompileTimeError
-type_promotion_parameter_test/03: MissingCompileTimeError
-type_promotion_parameter_test/04: MissingCompileTimeError
-type_promotion_parameter_test/05: MissingCompileTimeError
-type_promotion_parameter_test/06: MissingCompileTimeError
-type_promotion_parameter_test/07: MissingCompileTimeError
-type_promotion_parameter_test/08: MissingCompileTimeError
-type_promotion_parameter_test/09: MissingCompileTimeError
-type_promotion_parameter_test/10: MissingCompileTimeError
-type_promotion_parameter_test/11: MissingCompileTimeError
-type_promotion_parameter_test/12: MissingCompileTimeError
-type_promotion_parameter_test/13: MissingCompileTimeError
-type_promotion_parameter_test/14: MissingCompileTimeError
-type_promotion_parameter_test/15: MissingCompileTimeError
-type_promotion_parameter_test/16: MissingCompileTimeError
-type_promotion_parameter_test/17: MissingCompileTimeError
-type_promotion_parameter_test/18: MissingCompileTimeError
-type_promotion_parameter_test/19: MissingCompileTimeError
-type_promotion_parameter_test/20: MissingCompileTimeError
-type_promotion_parameter_test/21: MissingCompileTimeError
-type_promotion_parameter_test/22: MissingCompileTimeError
-type_promotion_parameter_test/23: MissingCompileTimeError
-type_promotion_parameter_test/24: MissingCompileTimeError
-type_promotion_parameter_test/25: MissingCompileTimeError
-type_promotion_parameter_test/26: MissingCompileTimeError
-type_promotion_parameter_test/27: MissingCompileTimeError
-type_promotion_parameter_test/28: MissingCompileTimeError
-type_promotion_parameter_test/29: MissingCompileTimeError
-type_promotion_parameter_test/30: MissingCompileTimeError
-type_promotion_parameter_test/31: MissingCompileTimeError
-type_promotion_parameter_test/32: MissingCompileTimeError
-type_promotion_parameter_test/33: MissingCompileTimeError
-type_promotion_parameter_test/34: MissingCompileTimeError
-type_promotion_parameter_test/35: MissingCompileTimeError
-type_promotion_parameter_test/36: MissingCompileTimeError
-type_promotion_parameter_test/37: MissingCompileTimeError
-type_promotion_parameter_test/38: MissingCompileTimeError
-type_promotion_parameter_test/39: MissingCompileTimeError
-type_promotion_parameter_test/40: MissingCompileTimeError
-type_promotion_parameter_test/41: MissingCompileTimeError
-type_promotion_parameter_test/42: MissingCompileTimeError
-type_promotion_parameter_test/43: MissingCompileTimeError
-type_promotion_parameter_test/44: MissingCompileTimeError
-type_promotion_parameter_test/45: MissingCompileTimeError
-type_promotion_parameter_test/46: MissingCompileTimeError
-type_promotion_parameter_test/47: MissingCompileTimeError
-type_promotion_parameter_test/48: MissingCompileTimeError
-type_promotion_parameter_test/49: MissingCompileTimeError
-type_promotion_parameter_test/50: MissingCompileTimeError
-type_promotion_parameter_test/51: MissingCompileTimeError
-type_promotion_parameter_test/52: MissingCompileTimeError
-type_promotion_parameter_test/54: MissingCompileTimeError
-type_promotion_parameter_test/55: MissingCompileTimeError
-type_promotion_parameter_test/56: MissingCompileTimeError
+type_promotion_more_specific_test/04: CompileTimeError # Issue 31533
type_variable_bounds2_test: MissingCompileTimeError
type_variable_bounds3_test/00: MissingCompileTimeError
type_variable_bounds4_test/01: MissingCompileTimeError
@@ -1031,12 +779,6 @@
type_variable_bounds_test/06: MissingCompileTimeError
type_variable_bounds_test/08: MissingCompileTimeError
type_variable_bounds_test/11: MissingCompileTimeError
-type_variable_conflict2_test/01: MissingCompileTimeError
-type_variable_conflict2_test/05: MissingCompileTimeError
-type_variable_conflict2_test/07: MissingCompileTimeError
-type_variable_conflict2_test/09: MissingCompileTimeError
-type_variable_identifier_expression_test: MissingCompileTimeError
-typed_selector2_test: MissingCompileTimeError
void_block_return_test/00: MissingCompileTimeError
void_type_callbacks_test/none: CompileTimeError
wrong_number_type_arguments_test/01: MissingCompileTimeError
@@ -1246,7 +988,6 @@
generic_method_types_test/02: RuntimeError
generic_methods_type_expression_test: RuntimeError # Expect.isTrue(false) fails.
generic_methods_unused_parameter_test: RuntimeError # Expect.isTrue(false) fails.
-generic_no_such_method_dispatcher_test: RuntimeError # NoSuchMethodError: method not found: '+'
generic_test: RuntimeError # ReferenceError: BOfT is not defined
implicit_downcast_during_function_literal_arrow_test: RuntimeError
issue13179_test: RuntimeError
@@ -1274,12 +1015,9 @@
recursive_inheritance_test: RuntimeError # Expect.isTrue(false) fails.
redirecting_factory_long_test: RuntimeError # Expect.isTrue(false) fails.
redirecting_factory_reflection_test: RuntimeError # UnimplementedError: node <InvalidExpression> `invalid-expression`
-regress_23408_test: RuntimeError # Expect.equals(expected: <K>, actual: <dynamic>) fails.
regress_24283_test: RuntimeError # Expect.equals(expected: <-1>, actual: <4294967295>) fails.
regress_30339_test: RuntimeError # Uncaught Expect.isTrue(false) fails.
runtime_type_function_test: RuntimeError # Expect.fail('Type print string does not match expectation
-string_interpolate_test: RuntimeError # Uncaught Type 'PrivateSymbol' is not a subtype of type 'Symbol' in strong mode
-super_bound_closure_test/none: RuntimeError # TypeError: Cannot read property '0' of undefined
syncstar_yield_test/copyParameters: RuntimeError # Expect.equals(expected: <2>, actual: <3>) fails.
type_literal_test: RuntimeError # Expect.equals(expected: <Func>, actual: <(bool) => int>) fails.
type_promotion_functions_test/02: RuntimeError
diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status
index 2d55e87..dd9fc36 100644
--- a/tests/language_2/language_2_kernel.status
+++ b/tests/language_2/language_2_kernel.status
@@ -114,13 +114,8 @@
call_nonexistent_static_test/08: MissingCompileTimeError
call_nonexistent_static_test/09: MissingCompileTimeError
call_nonexistent_static_test/10: MissingCompileTimeError
-call_through_getter_test/01: MissingCompileTimeError
-call_through_getter_test/02: MissingCompileTimeError
-call_type_literal_test/01: MissingCompileTimeError
call_with_no_such_method_test: CompileTimeError # Issue 31402 (Invocation arguments)
callable_test/none: CompileTimeError # Issue 31402 (Variable declaration)
-cast_test/04: MissingCompileTimeError
-cast_test/05: MissingCompileTimeError
cha_deopt1_test: CompileTimeError # KernelVM bug: Deferred loading kernel issue 28335.
cha_deopt1_test: RuntimeError
cha_deopt2_test: CompileTimeError # KernelVM bug: Deferred loading kernel issue 28335.
@@ -130,61 +125,27 @@
check_member_static_test/01: MissingCompileTimeError
check_method_override_test/01: MissingCompileTimeError
check_method_override_test/02: MissingCompileTimeError
-checked_null_test/01: MissingCompileTimeError
-class_literal_static_test/01: MissingCompileTimeError
-class_literal_static_test/02: MissingCompileTimeError
-class_literal_static_test/03: MissingCompileTimeError
-class_literal_static_test/04: MissingCompileTimeError
-class_literal_static_test/05: MissingCompileTimeError
-class_literal_static_test/06: MissingCompileTimeError
-class_literal_static_test/07: MissingCompileTimeError
-class_literal_static_test/08: MissingCompileTimeError
-class_literal_static_test/09: MissingCompileTimeError
-class_literal_static_test/10: MissingCompileTimeError
-class_literal_static_test/11: MissingCompileTimeError
class_literal_static_test/12: MissingCompileTimeError
class_literal_static_test/13: MissingCompileTimeError
-class_literal_static_test/14: MissingCompileTimeError
-class_literal_static_test/15: MissingCompileTimeError
-class_literal_static_test/16: MissingCompileTimeError
class_literal_static_test/17: MissingCompileTimeError
class_literal_static_test/18: MissingCompileTimeError
class_literal_static_test/19: MissingCompileTimeError
class_literal_static_test/20: MissingCompileTimeError
class_literal_static_test/21: MissingCompileTimeError
class_literal_static_test/22: MissingCompileTimeError
-class_literal_static_test/23: MissingCompileTimeError
class_literal_static_test/24: MissingCompileTimeError
class_literal_static_test/25: MissingCompileTimeError
-class_literal_test/01: MissingCompileTimeError
-class_literal_test/02: MissingCompileTimeError
-class_literal_test/03: MissingCompileTimeError
-class_literal_test/04: MissingCompileTimeError
-class_literal_test/05: MissingCompileTimeError
-class_literal_test/06: MissingCompileTimeError
-class_literal_test/07: MissingCompileTimeError
-class_literal_test/08: MissingCompileTimeError
-class_literal_test/09: MissingCompileTimeError
-class_literal_test/10: MissingCompileTimeError
-class_literal_test/11: MissingCompileTimeError
class_literal_test/12: MissingCompileTimeError
class_literal_test/13: MissingCompileTimeError
-class_literal_test/14: MissingCompileTimeError
-class_literal_test/15: MissingCompileTimeError
-class_literal_test/16: MissingCompileTimeError
class_literal_test/17: MissingCompileTimeError
class_literal_test/18: MissingCompileTimeError
class_literal_test/19: MissingCompileTimeError
class_literal_test/20: MissingCompileTimeError
class_literal_test/21: MissingCompileTimeError
class_literal_test/22: MissingCompileTimeError
-class_literal_test/23: MissingCompileTimeError
class_literal_test/24: MissingCompileTimeError
class_literal_test/25: MissingCompileTimeError
class_override_test: MissingCompileTimeError
-closure_internals_test/01: MissingCompileTimeError
-closure_internals_test/02: MissingCompileTimeError
-closure_internals_test/03: MissingCompileTimeError
closure_invoked_through_interface_target_field_test: MissingCompileTimeError
closure_invoked_through_interface_target_getter_test: MissingCompileTimeError
compile_time_constant_c_test/02: MissingCompileTimeError # KernelVM bug: Constant evaluation.
@@ -202,19 +163,12 @@
conditional_import_string_test: DartkCompileTimeError
conditional_import_test: CompileTimeError # KernelVM bug: Deferred loading kernel issue 28335.
conditional_import_test: DartkCompileTimeError
-conditional_method_invocation_test/07: MissingCompileTimeError
conditional_method_invocation_test/12: MissingCompileTimeError
conditional_method_invocation_test/13: MissingCompileTimeError
-conditional_property_access_test/05: MissingCompileTimeError
-conditional_property_access_test/06: MissingCompileTimeError
conditional_property_access_test/10: MissingCompileTimeError
conditional_property_access_test/11: MissingCompileTimeError
-conditional_property_assignment_test/05: MissingCompileTimeError
-conditional_property_assignment_test/06: MissingCompileTimeError
-conditional_property_assignment_test/10: MissingCompileTimeError
-conditional_property_assignment_test/11: MissingCompileTimeError
conditional_rewrite_test: RuntimeError # Issue 31402 (Not)
-config_import_corelib_test: RuntimeError # KernelVM bug: Configurable imports.
+config_import_corelib_test: CompileTimeError # Issue 31533
config_import_test: RuntimeError # KernelVM bug: Configurable imports.
const_constructor2_test/11: CompileTimeError # Issue 31402 (Invocation arguments)
const_constructor2_test/12: CompileTimeError # Issue 31402 (Invocation arguments)
@@ -256,7 +210,6 @@
constructor13_test/01: MissingCompileTimeError
constructor13_test/02: MissingCompileTimeError
constructor3_test: Fail, OK, Pass
-constructor_call_as_function_test/01: MissingCompileTimeError
constructor_duplicate_final_test/01: MissingCompileTimeError
constructor_duplicate_final_test/02: MissingCompileTimeError
constructor_named_arguments_test/01: MissingCompileTimeError
@@ -268,7 +221,6 @@
constructor_redirect_test/01: MissingCompileTimeError # Fasta bug: Initializer refers to this.
covariant_subtyping_test: CompileTimeError
covariant_subtyping_test: RuntimeError
-crash_6725_test/01: MissingCompileTimeError
create_unresolved_type_test/01: MissingCompileTimeError
ct_const2_test: Pass, Crash # Flaky
ct_const_test: RuntimeError
@@ -373,19 +325,15 @@
deferred_type_dependency_test/type_annotation: RuntimeError
disassemble_test: Pass, Slow
duplicate_export_negative_test: Fail # Issue 6134
-dynamic_field_test/01: MissingCompileTimeError
-dynamic_field_test/02: MissingCompileTimeError
dynamic_prefix_core_test/01: MissingCompileTimeError
dynamic_prefix_core_test/01: RuntimeError # KernelVM bug: Blocked on language issue 29125.
dynamic_prefix_core_test/none: RuntimeError
dynamic_test: CompileTimeError # Issue 31402 (Variable declaration)
dynamic_test: RuntimeError
+emit_const_fields_test: CompileTimeError # Issue 31533
empty_block_case_test: MissingCompileTimeError
enum_private_test/02: MissingCompileTimeError
-error_stacktrace_test/00: MissingCompileTimeError
example_constructor_test: Fail, OK
-export_ambiguous_main_test: MissingCompileTimeError
-export_ambiguous_main_test: Pass
external_test/10: MissingRuntimeError # KernelVM bug: Unbound external.
external_test/13: MissingRuntimeError # KernelVM bug: Unbound external.
external_test/20: MissingRuntimeError # KernelVM bug: Unbound external.
@@ -415,14 +363,8 @@
final_variable_assignment_test/04: MissingCompileTimeError
first_class_types_literals_test/03: MissingCompileTimeError
first_class_types_literals_test/04: MissingCompileTimeError
-first_class_types_literals_test/05: MissingCompileTimeError
-first_class_types_literals_test/06: MissingCompileTimeError
-first_class_types_literals_test/07: MissingCompileTimeError
first_class_types_literals_test/08: MissingCompileTimeError
first_class_types_literals_test/09: MissingCompileTimeError
-first_class_types_literals_test/10: MissingCompileTimeError
-first_class_types_literals_test/11: MissingCompileTimeError
-first_class_types_literals_test/12: MissingCompileTimeError
first_class_types_test: RuntimeError
flatten_test/05: MissingRuntimeError
flatten_test/08: MissingRuntimeError
@@ -583,48 +525,25 @@
generic_methods_type_expression_test: RuntimeError # Issue 25869 / 27460
generic_methods_unused_parameter_test: CompileTimeError # Issue 31402 (Variable declaration)
generic_methods_unused_parameter_test: RuntimeError
-generic_no_such_method_dispatcher_simple_test: RuntimeError
+generic_no_such_method_dispatcher_simple_test: CompileTimeError # Issue 31533
+generic_no_such_method_dispatcher_test: CompileTimeError # Issue 31533
generic_tearoff_test: CompileTimeError
generic_tearoff_test: RuntimeError
generic_test: RuntimeError
-getter_no_setter2_test/00: MissingCompileTimeError
getter_no_setter2_test/01: MissingCompileTimeError
getter_no_setter2_test/03: MissingCompileTimeError
-getter_no_setter_test/00: MissingCompileTimeError
getter_no_setter_test/01: MissingCompileTimeError
getter_no_setter_test/03: MissingCompileTimeError
getter_override_test/03: MissingCompileTimeError
-getters_setters2_test/02: MissingCompileTimeError
hello_dart_test: Crash # error: expected: cls.is_type_finalized()
identical_const_test/01: MissingCompileTimeError
identical_const_test/02: MissingCompileTimeError
identical_const_test/03: MissingCompileTimeError
identical_const_test/04: MissingCompileTimeError
-if_null_assignment_behavior_test/03: MissingCompileTimeError
if_null_assignment_behavior_test/13: MissingCompileTimeError
if_null_assignment_behavior_test/15: MissingCompileTimeError
-if_null_assignment_static_test/02: MissingCompileTimeError
-if_null_assignment_static_test/04: MissingCompileTimeError
-if_null_assignment_static_test/06: MissingCompileTimeError
-if_null_assignment_static_test/09: MissingCompileTimeError
-if_null_assignment_static_test/11: MissingCompileTimeError
-if_null_assignment_static_test/13: MissingCompileTimeError
-if_null_assignment_static_test/16: MissingCompileTimeError
-if_null_assignment_static_test/18: MissingCompileTimeError
-if_null_assignment_static_test/20: MissingCompileTimeError
-if_null_assignment_static_test/23: MissingCompileTimeError
-if_null_assignment_static_test/25: MissingCompileTimeError
-if_null_assignment_static_test/27: MissingCompileTimeError
-if_null_assignment_static_test/30: MissingCompileTimeError
-if_null_assignment_static_test/32: MissingCompileTimeError
-if_null_assignment_static_test/34: MissingCompileTimeError
-if_null_assignment_static_test/37: MissingCompileTimeError
-if_null_assignment_static_test/39: MissingCompileTimeError
-if_null_assignment_static_test/41: MissingCompileTimeError
if_null_evaluation_order_test: Pass
if_null_precedence_test/none: RuntimeError
-int64_literal_test/03: MissingCompileTimeError # http://dartbug.com/31479
-int64_literal_test/30: MissingCompileTimeError # http://dartbug.com/31479
implicit_downcast_during_function_literal_arrow_test: RuntimeError # Issue #31436
implicit_downcast_during_return_async_test: RuntimeError
implicit_this_test/01: MissingCompileTimeError
@@ -632,11 +551,12 @@
implicit_this_test/04: MissingCompileTimeError
import_combinators2_test/00: MissingCompileTimeError
import_self_test/01: MissingCompileTimeError
-inferrer_constructor5_test/01: MissingCompileTimeError
initializing_formal_final_test: MissingCompileTimeError
initializing_formal_type_annotation_test/01: MissingCompileTimeError
initializing_formal_type_annotation_test/02: MissingCompileTimeError
instanceof2_test: RuntimeError
+int64_literal_test/03: MissingCompileTimeError # http://dartbug.com/31479
+int64_literal_test/30: MissingCompileTimeError # http://dartbug.com/31479
interface_test/00: MissingCompileTimeError
invocation_mirror_test: CompileTimeError # Issue 31402 (Invocation arguments)
is_malformed_type_test/95: MissingCompileTimeError
@@ -668,12 +588,6 @@
known_identifier_prefix_error_test/24: MissingCompileTimeError # Issue 28814
language_2/least_upper_bound_expansive_test/none: CompileTimeError
least_upper_bound_expansive_test/none: CompileTimeError
-least_upper_bound_test/03: MissingCompileTimeError
-least_upper_bound_test/04: MissingCompileTimeError
-least_upper_bound_test/10: MissingCompileTimeError
-least_upper_bound_test/19: MissingCompileTimeError
-least_upper_bound_test/20: MissingCompileTimeError
-least_upper_bound_test/32: MissingCompileTimeError
library_ambiguous_test/00: MissingCompileTimeError
library_ambiguous_test/01: MissingCompileTimeError
library_ambiguous_test/02: MissingCompileTimeError
@@ -687,13 +601,10 @@
list_literal_syntax_test/02: MissingCompileTimeError
list_literal_syntax_test/03: MissingCompileTimeError
local_function2_test/none: RuntimeError
-local_function3_test/01: MissingCompileTimeError
local_function3_test/none: RuntimeError
local_function_test/01: MissingCompileTimeError
local_function_test/02: MissingCompileTimeError
-local_function_test/03: MissingCompileTimeError
local_function_test/none: RuntimeError
-logical_expression3_test: MissingCompileTimeError
main_not_a_function_test: DartkCrash
main_not_a_function_test: Skip
main_test/03: RuntimeError
@@ -727,7 +638,6 @@
malformed2_test/12: MissingCompileTimeError
malformed2_test/13: MissingCompileTimeError
malformed_bound_test/00: MissingCompileTimeError
-malformed_bound_test/01: MissingCompileTimeError
malformed_inheritance_test/01: MissingCompileTimeError
malformed_inheritance_test/03: MissingCompileTimeError
malformed_inheritance_test/05: MissingCompileTimeError
@@ -869,9 +779,7 @@
not_enough_positional_arguments_test/05: MissingCompileTimeError
not_enough_positional_arguments_test/06: MissingCompileTimeError
not_enough_positional_arguments_test/07: MissingCompileTimeError
-number_identifier_test/05: MissingCompileTimeError
-number_identifier_test/08: MissingCompileTimeError
-number_identifier_test/09: MissingCompileTimeError
+null_no_such_method_test: CompileTimeError # Issue 31533
on_catch_malformed_type_test: MissingCompileTimeError
optional_named_parameters_test/01: MissingCompileTimeError
optional_named_parameters_test/02: MissingCompileTimeError
@@ -954,7 +862,7 @@
override_inheritance_no_such_method_test/10: MissingCompileTimeError
override_inheritance_no_such_method_test/12: MissingCompileTimeError
override_inheritance_no_such_method_test/13: MissingCompileTimeError
-override_method_with_field_test/02: MissingCompileTimeError
+parser_quirks_test: CompileTimeError # Issue 31533
part2_test/01: MissingCompileTimeError
positional_parameters_type_test/01: MissingCompileTimeError
positional_parameters_type_test/02: MissingCompileTimeError
@@ -977,7 +885,6 @@
redirecting_factory_malbounded_test/01: MissingCompileTimeError
redirecting_factory_reflection_test: Crash, Pass
redirecting_factory_reflection_test: RuntimeError
-regress_12561_test: MissingCompileTimeError
regress_13494_test: MissingCompileTimeError
regress_17382_test: MissingCompileTimeError
regress_19413_test: MissingCompileTimeError
@@ -1000,44 +907,20 @@
regress_29784_test/01: MissingCompileTimeError
regress_29784_test/02: MissingCompileTimeError
regress_30339_test: CompileTimeError # Issue 31402 (Variable declaration)
-rewrite_implicit_this_test/01: MissingCompileTimeError
setter4_test: MissingCompileTimeError # Issue 14736
setter_override_test/01: MissingCompileTimeError
setter_override_test/02: MissingCompileTimeError
-static_field1_test/01: MissingCompileTimeError
-static_field1a_test/01: MissingCompileTimeError
static_field3_test/01: MissingCompileTimeError
static_field3_test/02: MissingCompileTimeError
static_field3_test/03: MissingCompileTimeError
static_field3_test/04: MissingCompileTimeError
-static_field_test/01: MissingCompileTimeError
-static_field_test/02: MissingCompileTimeError
-static_field_test/03: MissingCompileTimeError
-static_field_test/04: MissingCompileTimeError
static_final_field2_test/01: MissingCompileTimeError
static_getter_no_setter1_test/01: MissingCompileTimeError
static_getter_no_setter2_test/01: MissingCompileTimeError
static_setter_get_test/01: MissingCompileTimeError
+string_interpolate_test: CompileTimeError # Issue 31533
string_interpolation_and_buffer_test: RuntimeError # Issue 31402 (Return and yield statements)
-string_interpolation_test/01: MissingCompileTimeError
-string_no_operator_test/01: MissingCompileTimeError
-string_no_operator_test/02: MissingCompileTimeError
-string_no_operator_test/03: MissingCompileTimeError
-string_no_operator_test/04: MissingCompileTimeError
-string_no_operator_test/05: MissingCompileTimeError
-string_no_operator_test/07: MissingCompileTimeError
-string_no_operator_test/08: MissingCompileTimeError
-string_no_operator_test/09: MissingCompileTimeError
-string_no_operator_test/10: MissingCompileTimeError
-string_no_operator_test/11: MissingCompileTimeError
-string_no_operator_test/12: MissingCompileTimeError
-string_no_operator_test/13: MissingCompileTimeError
-string_no_operator_test/14: MissingCompileTimeError
-string_no_operator_test/15: MissingCompileTimeError
-string_no_operator_test/16: MissingCompileTimeError
-string_test/01: MissingCompileTimeError
-super_assign_test/01: MissingCompileTimeError
-super_bound_closure_test/01: MissingCompileTimeError
+super_bound_closure_test/none: CompileTimeError # Issue 31533
super_call4_test/01: MissingCompileTimeError
super_call4_test/02: MissingCompileTimeError
super_call4_test/03: MissingCompileTimeError
@@ -1066,7 +949,6 @@
switch_case_test/01: MissingCompileTimeError # KernelVM bug: Constant evaluation.
switch_case_test/02: MissingCompileTimeError # KernelVM bug: Constant evaluation.
switch_fallthru_test/01: MissingCompileTimeError
-symbol_literal_test/01: MissingCompileTimeError
syntax_test/28: MissingCompileTimeError
syntax_test/29: MissingCompileTimeError
syntax_test/30: MissingCompileTimeError
@@ -1081,7 +963,6 @@
try_catch_on_syntax_test/11: MissingCompileTimeError
try_catch_syntax_test/08: MissingCompileTimeError
type_error_test: RuntimeError # Issue 31402 (Variable declaration)
-type_literal_prefix_call_test/00: MissingCompileTimeError
type_literal_test: RuntimeError
type_parameter_test/01: MissingCompileTimeError
type_parameter_test/02: MissingCompileTimeError
@@ -1089,24 +970,6 @@
type_parameter_test/07: MissingCompileTimeError
type_parameter_test/08: MissingCompileTimeError
type_parameter_test/09: MissingCompileTimeError
-type_promotion_assign_test/01: MissingCompileTimeError
-type_promotion_assign_test/02: MissingCompileTimeError
-type_promotion_assign_test/03: MissingCompileTimeError
-type_promotion_assign_test/04: MissingCompileTimeError
-type_promotion_closure_test/01: MissingCompileTimeError
-type_promotion_closure_test/02: MissingCompileTimeError
-type_promotion_closure_test/03: MissingCompileTimeError
-type_promotion_closure_test/04: MissingCompileTimeError
-type_promotion_closure_test/06: MissingCompileTimeError
-type_promotion_closure_test/07: MissingCompileTimeError
-type_promotion_closure_test/09: MissingCompileTimeError
-type_promotion_closure_test/10: MissingCompileTimeError
-type_promotion_closure_test/11: MissingCompileTimeError
-type_promotion_closure_test/12: MissingCompileTimeError
-type_promotion_closure_test/13: MissingCompileTimeError
-type_promotion_closure_test/14: MissingCompileTimeError
-type_promotion_closure_test/15: MissingCompileTimeError
-type_promotion_closure_test/16: MissingCompileTimeError
type_promotion_functions_test/02: RuntimeError # Issue 31402 (Variable declaration)
type_promotion_functions_test/03: RuntimeError # Issue 31402 (Variable declaration)
type_promotion_functions_test/04: RuntimeError # Issue 31402 (Variable declaration)
@@ -1116,129 +979,8 @@
type_promotion_functions_test/13: RuntimeError # Issue 31402 (Variable declaration)
type_promotion_functions_test/14: RuntimeError # Issue 31402 (Variable declaration)
type_promotion_functions_test/none: RuntimeError # Issue 31402 (Variable declaration)
-type_promotion_local_test/01: MissingCompileTimeError
-type_promotion_local_test/02: MissingCompileTimeError
-type_promotion_local_test/03: MissingCompileTimeError
-type_promotion_local_test/04: MissingCompileTimeError
-type_promotion_local_test/05: MissingCompileTimeError
-type_promotion_local_test/06: MissingCompileTimeError
-type_promotion_local_test/07: MissingCompileTimeError
-type_promotion_local_test/08: MissingCompileTimeError
-type_promotion_local_test/09: MissingCompileTimeError
-type_promotion_local_test/10: MissingCompileTimeError
-type_promotion_local_test/11: MissingCompileTimeError
-type_promotion_local_test/12: MissingCompileTimeError
-type_promotion_local_test/13: MissingCompileTimeError
-type_promotion_local_test/14: MissingCompileTimeError
-type_promotion_local_test/15: MissingCompileTimeError
-type_promotion_local_test/16: MissingCompileTimeError
-type_promotion_local_test/17: MissingCompileTimeError
-type_promotion_local_test/18: MissingCompileTimeError
-type_promotion_local_test/19: MissingCompileTimeError
-type_promotion_local_test/20: MissingCompileTimeError
-type_promotion_local_test/21: MissingCompileTimeError
-type_promotion_local_test/22: MissingCompileTimeError
-type_promotion_local_test/23: MissingCompileTimeError
-type_promotion_local_test/24: MissingCompileTimeError
-type_promotion_local_test/25: MissingCompileTimeError
-type_promotion_local_test/26: MissingCompileTimeError
-type_promotion_local_test/27: MissingCompileTimeError
-type_promotion_local_test/28: MissingCompileTimeError
-type_promotion_local_test/29: MissingCompileTimeError
-type_promotion_local_test/30: MissingCompileTimeError
-type_promotion_local_test/31: MissingCompileTimeError
-type_promotion_local_test/32: MissingCompileTimeError
-type_promotion_local_test/33: MissingCompileTimeError
-type_promotion_local_test/34: MissingCompileTimeError
-type_promotion_local_test/35: MissingCompileTimeError
-type_promotion_local_test/36: MissingCompileTimeError
-type_promotion_local_test/37: MissingCompileTimeError
-type_promotion_local_test/38: MissingCompileTimeError
-type_promotion_local_test/39: MissingCompileTimeError
-type_promotion_local_test/40: MissingCompileTimeError
-type_promotion_local_test/41: MissingCompileTimeError
type_promotion_logical_and_test/01: MissingCompileTimeError
-type_promotion_logical_and_test/02: MissingCompileTimeError
-type_promotion_logical_and_test/03: MissingCompileTimeError
-type_promotion_more_specific_test/02: MissingCompileTimeError
-type_promotion_more_specific_test/09: MissingCompileTimeError
-type_promotion_multiple_test/01: MissingCompileTimeError
-type_promotion_multiple_test/02: MissingCompileTimeError
-type_promotion_multiple_test/03: MissingCompileTimeError
-type_promotion_multiple_test/04: MissingCompileTimeError
-type_promotion_multiple_test/05: MissingCompileTimeError
-type_promotion_multiple_test/06: MissingCompileTimeError
-type_promotion_multiple_test/07: MissingCompileTimeError
-type_promotion_multiple_test/08: MissingCompileTimeError
-type_promotion_multiple_test/09: MissingCompileTimeError
-type_promotion_multiple_test/10: MissingCompileTimeError
-type_promotion_multiple_test/11: MissingCompileTimeError
-type_promotion_multiple_test/12: MissingCompileTimeError
-type_promotion_multiple_test/13: MissingCompileTimeError
-type_promotion_multiple_test/14: MissingCompileTimeError
-type_promotion_multiple_test/15: MissingCompileTimeError
-type_promotion_multiple_test/16: MissingCompileTimeError
-type_promotion_multiple_test/17: MissingCompileTimeError
-type_promotion_multiple_test/18: MissingCompileTimeError
-type_promotion_multiple_test/19: MissingCompileTimeError
-type_promotion_multiple_test/20: MissingCompileTimeError
-type_promotion_multiple_test/21: MissingCompileTimeError
-type_promotion_multiple_test/22: MissingCompileTimeError
-type_promotion_parameter_test/01: MissingCompileTimeError
-type_promotion_parameter_test/02: MissingCompileTimeError
-type_promotion_parameter_test/03: MissingCompileTimeError
-type_promotion_parameter_test/04: MissingCompileTimeError
-type_promotion_parameter_test/05: MissingCompileTimeError
-type_promotion_parameter_test/06: MissingCompileTimeError
-type_promotion_parameter_test/07: MissingCompileTimeError
-type_promotion_parameter_test/08: MissingCompileTimeError
-type_promotion_parameter_test/09: MissingCompileTimeError
-type_promotion_parameter_test/10: MissingCompileTimeError
-type_promotion_parameter_test/11: MissingCompileTimeError
-type_promotion_parameter_test/12: MissingCompileTimeError
-type_promotion_parameter_test/13: MissingCompileTimeError
-type_promotion_parameter_test/14: MissingCompileTimeError
-type_promotion_parameter_test/15: MissingCompileTimeError
-type_promotion_parameter_test/16: MissingCompileTimeError
-type_promotion_parameter_test/17: MissingCompileTimeError
-type_promotion_parameter_test/18: MissingCompileTimeError
-type_promotion_parameter_test/19: MissingCompileTimeError
-type_promotion_parameter_test/20: MissingCompileTimeError
-type_promotion_parameter_test/21: MissingCompileTimeError
-type_promotion_parameter_test/22: MissingCompileTimeError
-type_promotion_parameter_test/23: MissingCompileTimeError
-type_promotion_parameter_test/24: MissingCompileTimeError
-type_promotion_parameter_test/25: MissingCompileTimeError
-type_promotion_parameter_test/26: MissingCompileTimeError
-type_promotion_parameter_test/27: MissingCompileTimeError
-type_promotion_parameter_test/28: MissingCompileTimeError
-type_promotion_parameter_test/29: MissingCompileTimeError
-type_promotion_parameter_test/30: MissingCompileTimeError
-type_promotion_parameter_test/31: MissingCompileTimeError
-type_promotion_parameter_test/32: MissingCompileTimeError
-type_promotion_parameter_test/33: MissingCompileTimeError
-type_promotion_parameter_test/34: MissingCompileTimeError
-type_promotion_parameter_test/35: MissingCompileTimeError
-type_promotion_parameter_test/36: MissingCompileTimeError
-type_promotion_parameter_test/37: MissingCompileTimeError
-type_promotion_parameter_test/38: MissingCompileTimeError
-type_promotion_parameter_test/39: MissingCompileTimeError
-type_promotion_parameter_test/40: MissingCompileTimeError
-type_promotion_parameter_test/41: MissingCompileTimeError
-type_promotion_parameter_test/42: MissingCompileTimeError
-type_promotion_parameter_test/43: MissingCompileTimeError
-type_promotion_parameter_test/44: MissingCompileTimeError
-type_promotion_parameter_test/45: MissingCompileTimeError
-type_promotion_parameter_test/46: MissingCompileTimeError
-type_promotion_parameter_test/47: MissingCompileTimeError
-type_promotion_parameter_test/48: MissingCompileTimeError
-type_promotion_parameter_test/49: MissingCompileTimeError
-type_promotion_parameter_test/50: MissingCompileTimeError
-type_promotion_parameter_test/51: MissingCompileTimeError
-type_promotion_parameter_test/52: MissingCompileTimeError
-type_promotion_parameter_test/54: MissingCompileTimeError
-type_promotion_parameter_test/55: MissingCompileTimeError
-type_promotion_parameter_test/56: MissingCompileTimeError
+type_promotion_more_specific_test/04: CompileTimeError # Issue 31533
type_variable_bounds2_test: MissingCompileTimeError
type_variable_bounds3_test/00: MissingCompileTimeError
type_variable_bounds4_test/01: MissingCompileTimeError
@@ -1254,21 +996,14 @@
type_variable_bounds_test/09: MissingCompileTimeError
type_variable_bounds_test/10: MissingCompileTimeError
type_variable_bounds_test/11: MissingCompileTimeError
-type_variable_conflict2_test/01: MissingCompileTimeError
type_variable_conflict2_test/03: MissingCompileTimeError
type_variable_conflict2_test/04: MissingCompileTimeError
-type_variable_conflict2_test/05: MissingCompileTimeError
-type_variable_conflict2_test/07: MissingCompileTimeError
-type_variable_conflict2_test/09: MissingCompileTimeError
-type_variable_identifier_expression_test: MissingCompileTimeError
type_variable_scope2_test: MissingCompileTimeError
type_variable_scope_test/00: MissingCompileTimeError
type_variable_scope_test/01: MissingCompileTimeError
type_variable_scope_test/04: MissingCompileTimeError
type_variable_scope_test/05: MissingCompileTimeError
type_variable_static_context_test: MissingCompileTimeError
-typed_selector2_test: MissingCompileTimeError
-unbound_getter_test: MissingCompileTimeError
unresolved_default_constructor_test/01: MissingCompileTimeError
unresolved_in_factory_test: MissingCompileTimeError
unresolved_top_level_method_test: MissingCompileTimeError
@@ -1564,20 +1299,14 @@
call_nonexistent_static_test/08: MissingCompileTimeError
call_nonexistent_static_test/09: MissingCompileTimeError
call_nonexistent_static_test/10: MissingCompileTimeError
-call_through_getter_test/01: MissingCompileTimeError
-call_through_getter_test/02: MissingCompileTimeError
-call_type_literal_test/01: MissingCompileTimeError
call_with_no_such_method_test: CompileTimeError # Issue 31402 (Invocation arguments)
callable_test/none: CompileTimeError # Issue 31402 (Variable declaration)
-cast_test/04: MissingCompileTimeError
-cast_test/05: MissingCompileTimeError
cha_deopt1_test: CompileTimeError # KernelVM bug: Deferred loading kernel issue 28335.
cha_deopt2_test: CompileTimeError # KernelVM bug: Deferred loading kernel issue 28335.
cha_deopt3_test: CompileTimeError # KernelVM bug: Deferred loading kernel issue 28335.
check_member_static_test/01: MissingCompileTimeError
check_method_override_test/01: MissingCompileTimeError
check_method_override_test/02: MissingCompileTimeError
-checked_null_test/01: MissingCompileTimeError
checked_setter2_test: MissingCompileTimeError
checked_setter3_test/01: MissingCompileTimeError
checked_setter3_test/02: MissingCompileTimeError
@@ -1586,60 +1315,27 @@
class_cycle_test/03: MissingCompileTimeError
class_keyword_test/02: MissingCompileTimeError # Issue 13627
class_keyword_test/02: Pass
-class_literal_static_test/01: MissingCompileTimeError
-class_literal_static_test/02: MissingCompileTimeError
-class_literal_static_test/03: MissingCompileTimeError
-class_literal_static_test/04: MissingCompileTimeError
-class_literal_static_test/05: MissingCompileTimeError
-class_literal_static_test/06: MissingCompileTimeError
-class_literal_static_test/07: MissingCompileTimeError
-class_literal_static_test/08: MissingCompileTimeError
-class_literal_static_test/09: MissingCompileTimeError
-class_literal_static_test/10: MissingCompileTimeError
-class_literal_static_test/11: MissingCompileTimeError
class_literal_static_test/12: MissingCompileTimeError
class_literal_static_test/13: MissingCompileTimeError
-class_literal_static_test/14: MissingCompileTimeError
-class_literal_static_test/15: MissingCompileTimeError
-class_literal_static_test/16: MissingCompileTimeError
class_literal_static_test/17: MissingCompileTimeError
class_literal_static_test/18: MissingCompileTimeError
class_literal_static_test/19: MissingCompileTimeError
class_literal_static_test/20: MissingCompileTimeError
class_literal_static_test/21: MissingCompileTimeError
class_literal_static_test/22: MissingCompileTimeError
-class_literal_static_test/23: MissingCompileTimeError
class_literal_static_test/24: MissingCompileTimeError
class_literal_static_test/25: MissingCompileTimeError
-class_literal_test/01: MissingCompileTimeError
-class_literal_test/02: MissingCompileTimeError
-class_literal_test/03: MissingCompileTimeError
-class_literal_test/04: MissingCompileTimeError
-class_literal_test/05: MissingCompileTimeError
-class_literal_test/06: MissingCompileTimeError
-class_literal_test/07: MissingCompileTimeError
-class_literal_test/08: MissingCompileTimeError
-class_literal_test/09: MissingCompileTimeError
-class_literal_test/10: MissingCompileTimeError
-class_literal_test/11: MissingCompileTimeError
class_literal_test/12: MissingCompileTimeError
class_literal_test/13: MissingCompileTimeError
-class_literal_test/14: MissingCompileTimeError
-class_literal_test/15: MissingCompileTimeError
-class_literal_test/16: MissingCompileTimeError
class_literal_test/17: MissingCompileTimeError
class_literal_test/18: MissingCompileTimeError
class_literal_test/19: MissingCompileTimeError
class_literal_test/20: MissingCompileTimeError
class_literal_test/21: MissingCompileTimeError
class_literal_test/22: MissingCompileTimeError
-class_literal_test/23: MissingCompileTimeError
class_literal_test/24: MissingCompileTimeError
class_literal_test/25: MissingCompileTimeError
class_override_test: MissingCompileTimeError
-closure_internals_test/01: MissingCompileTimeError
-closure_internals_test/02: MissingCompileTimeError
-closure_internals_test/03: MissingCompileTimeError
closure_invoked_through_interface_target_field_test: MissingCompileTimeError
closure_invoked_through_interface_target_getter_test: MissingCompileTimeError
compile_time_constant_c_test/02: MissingCompileTimeError # KernelVM bug: Constant evaluation.
@@ -1655,19 +1351,12 @@
compile_time_constant_static5_test/23: CompileTimeError # Issue 31402 (Field declaration)
conditional_import_string_test: CompileTimeError # KernelVM bug: Deferred loading kernel issue 28335.
conditional_import_test: CompileTimeError # KernelVM bug: Deferred loading kernel issue 28335.
-conditional_method_invocation_test/07: MissingCompileTimeError
conditional_method_invocation_test/12: MissingCompileTimeError
conditional_method_invocation_test/13: MissingCompileTimeError
-conditional_property_access_test/05: MissingCompileTimeError
-conditional_property_access_test/06: MissingCompileTimeError
conditional_property_access_test/10: MissingCompileTimeError
conditional_property_access_test/11: MissingCompileTimeError
-conditional_property_assignment_test/05: MissingCompileTimeError
-conditional_property_assignment_test/06: MissingCompileTimeError
-conditional_property_assignment_test/10: MissingCompileTimeError
-conditional_property_assignment_test/11: MissingCompileTimeError
conditional_rewrite_test: RuntimeError # Issue 31402 (Not)
-config_import_corelib_test: RuntimeError # KernelVM bug: Configurable imports.
+config_import_corelib_test: CompileTimeError # Issue 31533
config_import_test: RuntimeError # KernelVM bug: Configurable imports.
const_constructor2_test/11: CompileTimeError # Issue 31402 (Invocation arguments)
const_constructor2_test/12: CompileTimeError # Issue 31402 (Invocation arguments)
@@ -1708,7 +1397,6 @@
constructor13_test/01: MissingCompileTimeError
constructor13_test/02: MissingCompileTimeError
constructor3_test: Fail, OK, Pass
-constructor_call_as_function_test/01: MissingCompileTimeError
constructor_duplicate_final_test/01: MissingCompileTimeError
constructor_duplicate_final_test/02: MissingCompileTimeError
constructor_named_arguments_test/01: MissingCompileTimeError
@@ -1720,7 +1408,6 @@
covariant_subtyping_test: CompileTimeError
covariant_subtyping_test: Crash
covariant_subtyping_with_substitution_test: RuntimeError
-crash_6725_test/01: MissingCompileTimeError
create_unresolved_type_test/01: MissingCompileTimeError
ct_const2_test: Skip # Incompatible flag: --compile_all
ct_const_test: RuntimeError
@@ -1815,21 +1502,17 @@
duplicate_implements_test/02: MissingCompileTimeError
duplicate_implements_test/03: MissingCompileTimeError
duplicate_implements_test/04: MissingCompileTimeError
-dynamic_field_test/01: MissingCompileTimeError
-dynamic_field_test/02: MissingCompileTimeError
dynamic_prefix_core_test/01: MissingCompileTimeError
dynamic_prefix_core_test/01: RuntimeError # KernelVM bug: Issue 12478, Blocked on language issue 29125.
dynamic_prefix_core_test/none: RuntimeError
dynamic_test: CompileTimeError # Issue 31402 (Variable declaration)
+emit_const_fields_test: CompileTimeError # Issue 31533
empty_block_case_test: MissingCompileTimeError
enum_mirror_test: SkipByDesign
enum_private_test/02: MissingCompileTimeError
-error_stacktrace_test/00: MissingCompileTimeError
example_constructor_test: Fail, OK
export_ambiguous_main_negative_test: Fail # Issue 14763
export_ambiguous_main_negative_test: Skip # Issue 29895
-export_ambiguous_main_test: Crash
-export_ambiguous_main_test: MissingCompileTimeError
export_double_same_main_test: Crash # Issue 29895
export_double_same_main_test: Skip # Issue 29895
external_test/10: MissingRuntimeError # KernelVM bug: Unbound external.
@@ -1870,14 +1553,8 @@
final_variable_assignment_test/04: MissingCompileTimeError
first_class_types_literals_test/03: MissingCompileTimeError
first_class_types_literals_test/04: MissingCompileTimeError
-first_class_types_literals_test/05: MissingCompileTimeError
-first_class_types_literals_test/06: MissingCompileTimeError
-first_class_types_literals_test/07: MissingCompileTimeError
first_class_types_literals_test/08: MissingCompileTimeError
first_class_types_literals_test/09: MissingCompileTimeError
-first_class_types_literals_test/10: MissingCompileTimeError
-first_class_types_literals_test/11: MissingCompileTimeError
-first_class_types_literals_test/12: MissingCompileTimeError
first_class_types_test: RuntimeError
flatten_test/05: MissingRuntimeError
flatten_test/08: MissingRuntimeError
@@ -2042,12 +1719,12 @@
generic_methods_type_expression_test: RuntimeError # Issue 25869 / 27460
generic_methods_unused_parameter_test: CompileTimeError # Issue 31402 (Variable declaration)
generic_methods_unused_parameter_test: RuntimeError
+generic_no_such_method_dispatcher_simple_test: CompileTimeError # Issue 31533
+generic_no_such_method_dispatcher_test: CompileTimeError # Issue 31533
generic_tearoff_test: CompileTimeError
generic_tearoff_test: RuntimeError
-getter_no_setter2_test/00: MissingCompileTimeError
getter_no_setter2_test/01: MissingCompileTimeError
getter_no_setter2_test/03: MissingCompileTimeError
-getter_no_setter_test/00: MissingCompileTimeError
getter_no_setter_test/01: MissingCompileTimeError
getter_no_setter_test/03: MissingCompileTimeError
getter_override_test/03: MissingCompileTimeError
@@ -2060,27 +1737,8 @@
identical_const_test/02: MissingCompileTimeError
identical_const_test/03: MissingCompileTimeError
identical_const_test/04: MissingCompileTimeError
-if_null_assignment_behavior_test/03: MissingCompileTimeError
if_null_assignment_behavior_test/13: MissingCompileTimeError
if_null_assignment_behavior_test/15: MissingCompileTimeError
-if_null_assignment_static_test/02: MissingCompileTimeError
-if_null_assignment_static_test/04: MissingCompileTimeError
-if_null_assignment_static_test/06: MissingCompileTimeError
-if_null_assignment_static_test/09: MissingCompileTimeError
-if_null_assignment_static_test/11: MissingCompileTimeError
-if_null_assignment_static_test/13: MissingCompileTimeError
-if_null_assignment_static_test/16: MissingCompileTimeError
-if_null_assignment_static_test/18: MissingCompileTimeError
-if_null_assignment_static_test/20: MissingCompileTimeError
-if_null_assignment_static_test/23: MissingCompileTimeError
-if_null_assignment_static_test/25: MissingCompileTimeError
-if_null_assignment_static_test/27: MissingCompileTimeError
-if_null_assignment_static_test/30: MissingCompileTimeError
-if_null_assignment_static_test/32: MissingCompileTimeError
-if_null_assignment_static_test/34: MissingCompileTimeError
-if_null_assignment_static_test/37: MissingCompileTimeError
-if_null_assignment_static_test/39: MissingCompileTimeError
-if_null_assignment_static_test/41: MissingCompileTimeError
if_null_precedence_test/none: RuntimeError
implicit_closure_test: Skip # Incompatible flag: --use_slow_path
implicit_downcast_during_assignment_test: Pass # Correctly passes.
@@ -2109,7 +1767,6 @@
implicit_this_test/04: MissingCompileTimeError
import_combinators2_test/00: MissingCompileTimeError
import_self_test/01: MissingCompileTimeError
-inferrer_constructor5_test/01: MissingCompileTimeError
initializing_formal_final_test: MissingCompileTimeError
initializing_formal_type_annotation_test/01: MissingCompileTimeError
initializing_formal_type_annotation_test/02: MissingCompileTimeError
@@ -2155,26 +1812,8 @@
known_identifier_prefix_error_test/23: MissingCompileTimeError # Issue 28814
known_identifier_prefix_error_test/24: MissingCompileTimeError # Issue 28814
language_2/least_upper_bound_expansive_test/none: CompileTimeError
-least_upper_bound_expansive_test/01: MissingCompileTimeError
-least_upper_bound_expansive_test/02: MissingCompileTimeError
-least_upper_bound_expansive_test/03: MissingCompileTimeError
-least_upper_bound_expansive_test/04: MissingCompileTimeError
-least_upper_bound_expansive_test/05: MissingCompileTimeError
-least_upper_bound_expansive_test/06: MissingCompileTimeError
-least_upper_bound_expansive_test/07: MissingCompileTimeError
-least_upper_bound_expansive_test/08: MissingCompileTimeError
-least_upper_bound_expansive_test/09: MissingCompileTimeError
-least_upper_bound_expansive_test/10: MissingCompileTimeError
-least_upper_bound_expansive_test/11: MissingCompileTimeError
-least_upper_bound_expansive_test/12: MissingCompileTimeError
least_upper_bound_expansive_test/none: CompileTimeError
least_upper_bound_expansive_test/none: RuntimeError
-least_upper_bound_test/03: MissingCompileTimeError
-least_upper_bound_test/04: MissingCompileTimeError
-least_upper_bound_test/10: MissingCompileTimeError
-least_upper_bound_test/19: MissingCompileTimeError
-least_upper_bound_test/20: MissingCompileTimeError
-least_upper_bound_test/32: MissingCompileTimeError
library_ambiguous_test/00: MissingCompileTimeError
library_ambiguous_test/01: MissingCompileTimeError
library_ambiguous_test/02: MissingCompileTimeError
@@ -2189,13 +1828,10 @@
list_literal_syntax_test/02: MissingCompileTimeError
list_literal_syntax_test/03: MissingCompileTimeError
local_function2_test/none: RuntimeError
-local_function3_test/01: MissingCompileTimeError
local_function3_test/none: RuntimeError
local_function_test/01: MissingCompileTimeError
local_function_test/02: MissingCompileTimeError
-local_function_test/03: MissingCompileTimeError
local_function_test/none: RuntimeError
-logical_expression3_test: MissingCompileTimeError
main_not_a_function_test: Skip
main_test/03: RuntimeError
malbounded_instantiation_test/01: MissingCompileTimeError
@@ -2230,7 +1866,6 @@
malformed2_test/12: MissingCompileTimeError
malformed2_test/13: MissingCompileTimeError
malformed_bound_test/00: MissingCompileTimeError
-malformed_bound_test/01: MissingCompileTimeError
malformed_inheritance_test/01: MissingCompileTimeError
malformed_inheritance_test/03: MissingCompileTimeError
malformed_inheritance_test/05: MissingCompileTimeError
@@ -2395,13 +2030,11 @@
not_enough_positional_arguments_test/05: MissingCompileTimeError
not_enough_positional_arguments_test/06: MissingCompileTimeError
not_enough_positional_arguments_test/07: MissingCompileTimeError
+null_no_such_method_test: CompileTimeError # Issue 31533
null_test/02: MissingCompileTimeError
null_test/03: MissingCompileTimeError
null_test/mirrors: Skip # Uses mirrors.
null_test/none: SkipByDesign
-number_identifier_test/05: MissingCompileTimeError
-number_identifier_test/08: MissingCompileTimeError
-number_identifier_test/09: MissingCompileTimeError
on_catch_malformed_type_test: MissingCompileTimeError
optional_named_parameters_test/01: MissingCompileTimeError
optional_named_parameters_test/02: Crash
@@ -2489,7 +2122,7 @@
override_inheritance_no_such_method_test/10: MissingCompileTimeError
override_inheritance_no_such_method_test/12: MissingCompileTimeError
override_inheritance_no_such_method_test/13: MissingCompileTimeError
-override_method_with_field_test/02: MissingCompileTimeError
+parser_quirks_test: CompileTimeError # Issue 31533
part2_test/01: MissingCompileTimeError
positional_parameters_type_test/01: Crash
positional_parameters_type_test/01: MissingCompileTimeError
@@ -2514,7 +2147,6 @@
redirecting_factory_infinite_steps_test/01: MissingCompileTimeError
redirecting_factory_malbounded_test/01: MissingCompileTimeError
redirecting_factory_reflection_test: SkipByDesign
-regress_12561_test: MissingCompileTimeError
regress_13462_0_test: SkipByDesign
regress_13462_1_test: SkipByDesign
regress_13494_test: MissingCompileTimeError
@@ -2543,45 +2175,22 @@
regress_29784_test/01: MissingCompileTimeError
regress_29784_test/02: MissingCompileTimeError
regress_30339_test: CompileTimeError # Issue 31402 (Variable declaration)
-rewrite_implicit_this_test/01: MissingCompileTimeError
setter4_test: MissingCompileTimeError # Issue 14736
+setter_no_getter_test/01: CompileTimeError # Issue 31533
setter_override_test/01: MissingCompileTimeError
setter_override_test/02: MissingCompileTimeError
stacktrace_demangle_ctors_test: RuntimeError
-static_field1_test/01: MissingCompileTimeError
-static_field1a_test/01: MissingCompileTimeError
static_field3_test/01: MissingCompileTimeError
static_field3_test/02: MissingCompileTimeError
static_field3_test/03: MissingCompileTimeError
static_field3_test/04: MissingCompileTimeError
-static_field_test/01: MissingCompileTimeError
-static_field_test/02: MissingCompileTimeError
-static_field_test/03: MissingCompileTimeError
-static_field_test/04: MissingCompileTimeError
static_final_field2_test/01: MissingCompileTimeError
static_getter_no_setter1_test/01: MissingCompileTimeError
static_getter_no_setter2_test/01: MissingCompileTimeError
static_setter_get_test/01: MissingCompileTimeError
+string_interpolate_test: CompileTimeError # Issue 31533
string_interpolation_and_buffer_test: RuntimeError # Issue 31402 (Return and yield statements)
-string_interpolation_test/01: MissingCompileTimeError
-string_no_operator_test/01: MissingCompileTimeError
-string_no_operator_test/02: MissingCompileTimeError
-string_no_operator_test/03: MissingCompileTimeError
-string_no_operator_test/04: MissingCompileTimeError
-string_no_operator_test/05: MissingCompileTimeError
-string_no_operator_test/07: MissingCompileTimeError
-string_no_operator_test/08: MissingCompileTimeError
-string_no_operator_test/09: MissingCompileTimeError
-string_no_operator_test/10: MissingCompileTimeError
-string_no_operator_test/11: MissingCompileTimeError
-string_no_operator_test/12: MissingCompileTimeError
-string_no_operator_test/13: MissingCompileTimeError
-string_no_operator_test/14: MissingCompileTimeError
-string_no_operator_test/15: MissingCompileTimeError
-string_no_operator_test/16: MissingCompileTimeError
-string_test/01: MissingCompileTimeError
-super_assign_test/01: MissingCompileTimeError
-super_bound_closure_test/01: MissingCompileTimeError
+super_bound_closure_test/none: CompileTimeError # Issue 31533
super_call4_test: CompileTimeError
super_call4_test: RuntimeError
super_getter_setter_test: CompileTimeError
@@ -2600,7 +2209,6 @@
switch_case_test/01: MissingCompileTimeError # KernelVM bug: Constant evaluation.
switch_case_test/02: MissingCompileTimeError # KernelVM bug: Constant evaluation.
switch_fallthru_test/01: MissingCompileTimeError
-symbol_literal_test/01: MissingCompileTimeError
syntax_test/00: MissingCompileTimeError
syntax_test/28: MissingCompileTimeError
syntax_test/29: MissingCompileTimeError
@@ -2616,7 +2224,6 @@
try_catch_on_syntax_test/11: MissingCompileTimeError
try_catch_syntax_test/08: MissingCompileTimeError
type_error_test: RuntimeError # Issue 31402 (Variable declaration)
-type_literal_prefix_call_test/00: MissingCompileTimeError
type_literal_test: RuntimeError
type_parameter_test/01: MissingCompileTimeError
type_parameter_test/02: MissingCompileTimeError
@@ -2624,24 +2231,6 @@
type_parameter_test/07: MissingCompileTimeError
type_parameter_test/08: MissingCompileTimeError
type_parameter_test/09: MissingCompileTimeError
-type_promotion_assign_test/01: MissingCompileTimeError
-type_promotion_assign_test/02: MissingCompileTimeError
-type_promotion_assign_test/03: MissingCompileTimeError
-type_promotion_assign_test/04: MissingCompileTimeError
-type_promotion_closure_test/01: MissingCompileTimeError
-type_promotion_closure_test/02: MissingCompileTimeError
-type_promotion_closure_test/03: MissingCompileTimeError
-type_promotion_closure_test/04: MissingCompileTimeError
-type_promotion_closure_test/06: MissingCompileTimeError
-type_promotion_closure_test/07: MissingCompileTimeError
-type_promotion_closure_test/09: MissingCompileTimeError
-type_promotion_closure_test/10: MissingCompileTimeError
-type_promotion_closure_test/11: MissingCompileTimeError
-type_promotion_closure_test/12: MissingCompileTimeError
-type_promotion_closure_test/13: MissingCompileTimeError
-type_promotion_closure_test/14: MissingCompileTimeError
-type_promotion_closure_test/15: MissingCompileTimeError
-type_promotion_closure_test/16: MissingCompileTimeError
type_promotion_functions_test/01: MissingCompileTimeError
type_promotion_functions_test/01: Pass
type_promotion_functions_test/02: Pass
@@ -2653,130 +2242,8 @@
type_promotion_functions_test/13: Pass
type_promotion_functions_test/14: Pass
type_promotion_functions_test/none: Pass
-type_promotion_local_test/01: MissingCompileTimeError
-type_promotion_local_test/02: MissingCompileTimeError
-type_promotion_local_test/03: MissingCompileTimeError
-type_promotion_local_test/04: MissingCompileTimeError
-type_promotion_local_test/05: MissingCompileTimeError
-type_promotion_local_test/06: MissingCompileTimeError
-type_promotion_local_test/07: MissingCompileTimeError
-type_promotion_local_test/08: MissingCompileTimeError
-type_promotion_local_test/09: MissingCompileTimeError
-type_promotion_local_test/10: MissingCompileTimeError
-type_promotion_local_test/11: MissingCompileTimeError
-type_promotion_local_test/12: MissingCompileTimeError
-type_promotion_local_test/13: MissingCompileTimeError
-type_promotion_local_test/14: MissingCompileTimeError
-type_promotion_local_test/15: MissingCompileTimeError
-type_promotion_local_test/16: MissingCompileTimeError
-type_promotion_local_test/17: MissingCompileTimeError
-type_promotion_local_test/18: MissingCompileTimeError
-type_promotion_local_test/19: MissingCompileTimeError
-type_promotion_local_test/20: MissingCompileTimeError
-type_promotion_local_test/21: MissingCompileTimeError
-type_promotion_local_test/22: MissingCompileTimeError
-type_promotion_local_test/23: MissingCompileTimeError
-type_promotion_local_test/24: MissingCompileTimeError
-type_promotion_local_test/25: MissingCompileTimeError
-type_promotion_local_test/26: MissingCompileTimeError
-type_promotion_local_test/27: MissingCompileTimeError
-type_promotion_local_test/28: MissingCompileTimeError
-type_promotion_local_test/29: MissingCompileTimeError
-type_promotion_local_test/30: MissingCompileTimeError
-type_promotion_local_test/31: MissingCompileTimeError
-type_promotion_local_test/32: MissingCompileTimeError
-type_promotion_local_test/33: MissingCompileTimeError
-type_promotion_local_test/34: MissingCompileTimeError
-type_promotion_local_test/35: MissingCompileTimeError
-type_promotion_local_test/36: MissingCompileTimeError
-type_promotion_local_test/37: MissingCompileTimeError
-type_promotion_local_test/38: MissingCompileTimeError
-type_promotion_local_test/39: MissingCompileTimeError
-type_promotion_local_test/40: MissingCompileTimeError
-type_promotion_local_test/41: MissingCompileTimeError
type_promotion_logical_and_test/01: MissingCompileTimeError
-type_promotion_logical_and_test/02: MissingCompileTimeError
-type_promotion_logical_and_test/03: MissingCompileTimeError
-type_promotion_more_specific_test/02: MissingCompileTimeError
-type_promotion_more_specific_test/04: Pass
-type_promotion_more_specific_test/09: MissingCompileTimeError
-type_promotion_multiple_test/01: MissingCompileTimeError
-type_promotion_multiple_test/02: MissingCompileTimeError
-type_promotion_multiple_test/03: MissingCompileTimeError
-type_promotion_multiple_test/04: MissingCompileTimeError
-type_promotion_multiple_test/05: MissingCompileTimeError
-type_promotion_multiple_test/06: MissingCompileTimeError
-type_promotion_multiple_test/07: MissingCompileTimeError
-type_promotion_multiple_test/08: MissingCompileTimeError
-type_promotion_multiple_test/09: MissingCompileTimeError
-type_promotion_multiple_test/10: MissingCompileTimeError
-type_promotion_multiple_test/11: MissingCompileTimeError
-type_promotion_multiple_test/12: MissingCompileTimeError
-type_promotion_multiple_test/13: MissingCompileTimeError
-type_promotion_multiple_test/14: MissingCompileTimeError
-type_promotion_multiple_test/15: MissingCompileTimeError
-type_promotion_multiple_test/16: MissingCompileTimeError
-type_promotion_multiple_test/17: MissingCompileTimeError
-type_promotion_multiple_test/18: MissingCompileTimeError
-type_promotion_multiple_test/19: MissingCompileTimeError
-type_promotion_multiple_test/20: MissingCompileTimeError
-type_promotion_multiple_test/21: MissingCompileTimeError
-type_promotion_multiple_test/22: MissingCompileTimeError
-type_promotion_parameter_test/01: MissingCompileTimeError
-type_promotion_parameter_test/02: MissingCompileTimeError
-type_promotion_parameter_test/03: MissingCompileTimeError
-type_promotion_parameter_test/04: MissingCompileTimeError
-type_promotion_parameter_test/05: MissingCompileTimeError
-type_promotion_parameter_test/06: MissingCompileTimeError
-type_promotion_parameter_test/07: MissingCompileTimeError
-type_promotion_parameter_test/08: MissingCompileTimeError
-type_promotion_parameter_test/09: MissingCompileTimeError
-type_promotion_parameter_test/10: MissingCompileTimeError
-type_promotion_parameter_test/11: MissingCompileTimeError
-type_promotion_parameter_test/12: MissingCompileTimeError
-type_promotion_parameter_test/13: MissingCompileTimeError
-type_promotion_parameter_test/14: MissingCompileTimeError
-type_promotion_parameter_test/15: MissingCompileTimeError
-type_promotion_parameter_test/16: MissingCompileTimeError
-type_promotion_parameter_test/17: MissingCompileTimeError
-type_promotion_parameter_test/18: MissingCompileTimeError
-type_promotion_parameter_test/19: MissingCompileTimeError
-type_promotion_parameter_test/20: MissingCompileTimeError
-type_promotion_parameter_test/21: MissingCompileTimeError
-type_promotion_parameter_test/22: MissingCompileTimeError
-type_promotion_parameter_test/23: MissingCompileTimeError
-type_promotion_parameter_test/24: MissingCompileTimeError
-type_promotion_parameter_test/25: MissingCompileTimeError
-type_promotion_parameter_test/26: MissingCompileTimeError
-type_promotion_parameter_test/27: MissingCompileTimeError
-type_promotion_parameter_test/28: MissingCompileTimeError
-type_promotion_parameter_test/29: MissingCompileTimeError
-type_promotion_parameter_test/30: MissingCompileTimeError
-type_promotion_parameter_test/31: MissingCompileTimeError
-type_promotion_parameter_test/32: MissingCompileTimeError
-type_promotion_parameter_test/33: MissingCompileTimeError
-type_promotion_parameter_test/34: MissingCompileTimeError
-type_promotion_parameter_test/35: MissingCompileTimeError
-type_promotion_parameter_test/36: MissingCompileTimeError
-type_promotion_parameter_test/37: MissingCompileTimeError
-type_promotion_parameter_test/38: MissingCompileTimeError
-type_promotion_parameter_test/39: MissingCompileTimeError
-type_promotion_parameter_test/40: MissingCompileTimeError
-type_promotion_parameter_test/41: MissingCompileTimeError
-type_promotion_parameter_test/42: MissingCompileTimeError
-type_promotion_parameter_test/43: MissingCompileTimeError
-type_promotion_parameter_test/44: MissingCompileTimeError
-type_promotion_parameter_test/45: MissingCompileTimeError
-type_promotion_parameter_test/46: MissingCompileTimeError
-type_promotion_parameter_test/47: MissingCompileTimeError
-type_promotion_parameter_test/48: MissingCompileTimeError
-type_promotion_parameter_test/49: MissingCompileTimeError
-type_promotion_parameter_test/50: MissingCompileTimeError
-type_promotion_parameter_test/51: MissingCompileTimeError
-type_promotion_parameter_test/52: MissingCompileTimeError
-type_promotion_parameter_test/54: MissingCompileTimeError
-type_promotion_parameter_test/55: MissingCompileTimeError
-type_promotion_parameter_test/56: MissingCompileTimeError
+type_promotion_more_specific_test/04: CompileTimeError # Issue 31533
type_variable_bounds2_test: MissingCompileTimeError
type_variable_bounds3_test/00: MissingCompileTimeError
type_variable_bounds4_test/01: MissingCompileTimeError
@@ -2792,13 +2259,8 @@
type_variable_bounds_test/09: MissingCompileTimeError
type_variable_bounds_test/10: MissingCompileTimeError
type_variable_bounds_test/11: MissingCompileTimeError
-type_variable_conflict2_test/01: MissingCompileTimeError
type_variable_conflict2_test/03: MissingCompileTimeError
type_variable_conflict2_test/04: MissingCompileTimeError
-type_variable_conflict2_test/05: MissingCompileTimeError
-type_variable_conflict2_test/07: MissingCompileTimeError
-type_variable_conflict2_test/09: MissingCompileTimeError
-type_variable_identifier_expression_test: MissingCompileTimeError
type_variable_nested_test/01: RuntimeError
type_variable_promotion_test: Pass
type_variable_promotion_test: RuntimeError
@@ -2810,8 +2272,6 @@
type_variable_scope_test/04: MissingCompileTimeError
type_variable_scope_test/05: MissingCompileTimeError
type_variable_static_context_test: MissingCompileTimeError
-typed_selector2_test: MissingCompileTimeError
-unbound_getter_test: MissingCompileTimeError
unicode_bom_test: Fail # Issue 16067
unicode_bom_test: Pass
unresolved_default_constructor_test/01: MissingCompileTimeError
@@ -3069,3 +2529,6 @@
vm/unaligned_integer_access_literal_index_test: CompileTimeError # Issue 31339
mint_arithmetic_test: CompileTimeError # Issue 31339
identical_closure2_test: CompileTimeError # Issue 31339
+mock_writable_final_field_test: RuntimeError # Issue 31424
+no_such_method_subtype_test: RuntimeError # Issue 31424
+generic_no_such_method_dispatcher_test: RuntimeError # Issue 31424
diff --git a/tests/language_2/language_2_precompiled.status b/tests/language_2/language_2_precompiled.status
index 7af15f2..db7e865 100644
--- a/tests/language_2/language_2_precompiled.status
+++ b/tests/language_2/language_2_precompiled.status
@@ -637,6 +637,9 @@
not_enough_positional_arguments_test/07: MissingCompileTimeError
null_test/mirrors: Skip # Uses mirrors.
null_test/none: SkipByDesign
+object_has_no_call_method_test/02: MissingCompileTimeError
+object_has_no_call_method_test/05: MissingCompileTimeError
+object_has_no_call_method_test/08: MissingCompileTimeError
optional_named_parameters_test/01: MissingCompileTimeError
optional_named_parameters_test/02: MissingCompileTimeError
optional_named_parameters_test/03: MissingCompileTimeError
@@ -993,6 +996,8 @@
assertion_initializer_const_error_test/01: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
callable_test/none: RuntimeError
+cascaded_forwarding_stubs_generic_test: RuntimeError
+cascaded_forwarding_stubs_test: RuntimeError
checked_setter2_test: RuntimeError
checked_setter3_test: RuntimeError
checked_setter_test: RuntimeError
diff --git a/tests/language_2/language_2_vm.status b/tests/language_2/language_2_vm.status
index ab80d49..e7acdb5 100644
--- a/tests/language_2/language_2_vm.status
+++ b/tests/language_2/language_2_vm.status
@@ -539,6 +539,9 @@
not_enough_positional_arguments_test/03: MissingCompileTimeError
not_enough_positional_arguments_test/06: MissingCompileTimeError
not_enough_positional_arguments_test/07: MissingCompileTimeError
+object_has_no_call_method_test/02: MissingCompileTimeError
+object_has_no_call_method_test/05: MissingCompileTimeError
+object_has_no_call_method_test/08: MissingCompileTimeError
optional_named_parameters_test/01: MissingCompileTimeError
optional_named_parameters_test/02: MissingCompileTimeError
optional_named_parameters_test/03: MissingCompileTimeError
@@ -932,6 +935,8 @@
bool_check_test: RuntimeError
bool_condition_check_test: RuntimeError
callable_test/none: RuntimeError
+cascaded_forwarding_stubs_generic_test: RuntimeError
+cascaded_forwarding_stubs_test: RuntimeError
checked_setter2_test: RuntimeError
checked_setter3_test: RuntimeError
checked_setter_test: RuntimeError
diff --git a/tests/language_2/object_has_no_call_method_test.dart b/tests/language_2/object_has_no_call_method_test.dart
new file mode 100644
index 0000000..cf334e8
--- /dev/null
+++ b/tests/language_2/object_has_no_call_method_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+void test(dynamic d, Object o, Function f) {
+ d(); //# 01: ok
+ o(); //# 02: compile-time error
+ f(); //# 03: ok
+ d.call; //# 04: ok
+ o.call; //# 05: compile-time error
+ f.call; //# 06: ok
+ d.call(); //# 07: ok
+ o.call(); //# 08: compile-time error
+ f.call(); //# 09: ok
+}
+
+main() {}
diff --git a/tests/lib_2/js/prototype_access_test.dart b/tests/lib_2/js/prototype_access_test.dart
new file mode 100644
index 0000000..fe93733
--- /dev/null
+++ b/tests/lib_2/js/prototype_access_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+@JS()
+library prototest;
+
+import 'package:js/js.dart';
+import 'package:expect/expect.dart';
+
+@JS('window.ArrayBuffer')
+external Class get arrayBufferClass;
+
+@JS('Function')
+class Class {
+ external dynamic get prototype;
+ external dynamic get constructor;
+}
+
+class Normal {
+ int prototype = 42;
+ Normal constructor() {
+ return this;
+ }
+
+ int operator [](int i) => prototype;
+}
+
+void main() {
+ Expect.isTrue(arrayBufferClass.prototype != null);
+ var normal = new Normal();
+ Expect.equals(42, normal.prototype);
+ Expect.equals(42, normal[0]);
+ Expect.isTrue(arrayBufferClass.constructor != null);
+ Expect.isTrue(arrayBufferClass.constructor is Function);
+ Expect.isTrue(normal.constructor is Function);
+ Expect.equals(normal, normal.constructor());
+}
diff --git a/tests/lib_2/lib_2_kernel.status b/tests/lib_2/lib_2_kernel.status
index 151aef4..0c63350 100644
--- a/tests/lib_2/lib_2_kernel.status
+++ b/tests/lib_2/lib_2_kernel.status
@@ -105,6 +105,7 @@
isolate/unresolved_ports_test: CompileTimeError # Issue 31402 (Invocation arguments)
js/datetime_roundtrip_test: CompileTimeError
js/null_test: CompileTimeError
+js/prototype_access_test: CompileTimeError
mirrors/abstract_class_test: RuntimeError
mirrors/abstract_test: CompileTimeError # Issue 31402 (Invocation arguments)
mirrors/class_declarations_test/01: CompileTimeError # Issue 31402 (Invocation arguments)
@@ -199,8 +200,9 @@
mirrors/method_mirror_name_test: CompileTimeError # Issue 31402 (Invocation arguments)
mirrors/method_mirror_source_line_ending_test: Crash
mirrors/method_mirror_source_test: Crash
-mirrors/mirrors_nsm_mismatch_test: RuntimeError
-mirrors/mirrors_nsm_test/dart2js: RuntimeError
+mirrors/mirrors_nsm_mismatch_test: CompileTimeError # Issue 31533
+mirrors/mirrors_nsm_test/dart2js: CompileTimeError # Issue 31533
+mirrors/mirrors_nsm_test/none: CompileTimeError # Issue 31533
mirrors/mirrors_reader_test: Crash
mirrors/mirrors_test: Crash
mirrors/mirrors_used*: SkipByDesign # Invalid tests. MirrorsUsed does not have a specification, and dart:mirrors is not required to hide declarations that are not covered by any MirrorsUsed annotation.
@@ -243,7 +245,7 @@
mirrors/reflected_type_typevars_test: RuntimeError
mirrors/regress_26187_test: RuntimeError
mirrors/relation_assignable_test: RuntimeError
-mirrors/relation_subclass_test: RuntimeError
+mirrors/relation_subclass_test: CompileTimeError # Issue 31533
mirrors/relation_subtype_test: RuntimeError
mirrors/repeated_private_anon_mixin_app_test: RuntimeError
mirrors/return_type_test: CompileTimeError # Issue 31402 (Invocation arguments)
@@ -478,6 +480,7 @@
isolate/typed_message_test: CompileTimeError # Issue 31402 (Invocation arguments)
js/datetime_roundtrip_test: CompileTimeError
js/null_test: CompileTimeError
+js/prototype_access_test: CompileTimeError
mirrors/*: SkipByDesign # Mirrors are not supported in AOT mode.
[ $compiler == dartkp && $runtime == dart_precompiled && $strong && $mode == debug]
diff --git a/tests/lib_2/lib_2_precompiled.status b/tests/lib_2/lib_2_precompiled.status
index 7438eb2..2f8ee97 100644
--- a/tests/lib_2/lib_2_precompiled.status
+++ b/tests/lib_2/lib_2_precompiled.status
@@ -38,6 +38,7 @@
isolate/unresolved_ports_test: SkipByDesign
js/datetime_roundtrip_test: CompileTimeError
js/null_test: CompileTimeError
+js/prototype_access_test: CompileTimeError
[ ($compiler == none || $compiler == precompiler || $compiler == app_jit) ]
async/timer_regress22626_test: Pass, RuntimeError # Issue 28254
diff --git a/tests/lib_2/lib_2_vm.status b/tests/lib_2/lib_2_vm.status
index 61fcb9e..819bd58 100644
--- a/tests/lib_2/lib_2_vm.status
+++ b/tests/lib_2/lib_2_vm.status
@@ -49,6 +49,7 @@
html/*: SkipByDesign # dart:html not supported on VM.
js/datetime_roundtrip_test: CompileTimeError
js/null_test: CompileTimeError
+js/prototype_access_test: CompileTimeError
mirrors/deferred_type_test: CompileTimeError
mirrors/generic_bounded_by_type_parameter_test/02: MissingCompileTimeError
mirrors/generic_bounded_test/01: MissingCompileTimeError
diff --git a/tests/standalone/script_snapshot_depfile_test.dart b/tests/standalone/script_snapshot_depfile_test.dart
new file mode 100644
index 0000000..3bcd2ec
--- /dev/null
+++ b/tests/standalone/script_snapshot_depfile_test.dart
@@ -0,0 +1,53 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "dart:io";
+
+void main(List<String> args) {
+ if (args.contains("--child")) {
+ print("Hello, pre-scanned world!");
+ } else {
+ generateSnapshot();
+ }
+}
+
+void generateSnapshot() {
+ var tempDir = Directory.systemTemp.createTempSync("script-snapshot");
+ var snapshotPath = tempDir.uri.resolve("hello.snapshot").toFilePath();
+ var depfilePath = tempDir.uri.resolve("hello.snapshot.d").toFilePath();
+ var scriptPath = Platform.script.toFilePath();
+
+ var exec = Platform.resolvedExecutable;
+ var args = new List();
+ args.addAll(Platform.executableArguments);
+ args.add("--snapshot=$snapshotPath");
+ args.add("--snapshot-depfile=$depfilePath");
+ args.add(scriptPath);
+ args.add("--child");
+ var result = Process.runSync(exec, args);
+
+ print("Exit code: ${result.exitCode}");
+ print("stdout:");
+ print(result.stdout);
+ print("stderr:");
+ print(result.stderr);
+
+ if (result.exitCode != 0) {
+ throw "Bad exit code: ${result.exitCode}";
+ }
+
+ var depfileContents = new File(depfilePath).readAsStringSync();
+ print("depfile:");
+ print(depfileContents);
+ if (!depfileContents.contains(snapshotPath)) {
+ print("snapshotPath:");
+ print(snapshotPath);
+ throw "Missing snapshot path";
+ }
+ if (!depfileContents.contains(scriptPath)) {
+ print("scriptPath:");
+ print(scriptPath);
+ throw "Missing script path";
+ }
+}
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 23dcff8..b5758d6 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -21,9 +21,11 @@
[ $runtime != vm || $compiler != none ]
script_snapshot_not_executed_test: SkipByDesign # Only makes sense running from source.
+script_snapshot_depfile_test: SkipByDesign # Only makes sense running from source.
-[ (($hot_reload) || ($hot_reload_rollback)) ]
-script_snapshot_not_executed_test: RuntimeError
+[ $hot_reload || $hot_reload_rollback ]
+script_snapshot_not_executed_test: RuntimeError, OK # Child VM doesn't execute Dart.
+script_snapshot_depfile_test: RuntimeError, OK # Child VM doesn't execute Dart.
[ $system == macos && $builder_tag == swarming ]
io/*: Skip # Issue 30618
diff --git a/tools/VERSION b/tools/VERSION
index ecb40bd..6644c98 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 0
PATCH 0
-PRERELEASE 10
+PRERELEASE 11
PRERELEASE_PATCH 0
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index aa3dd87..0f5186a 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -346,17 +346,6 @@
"--use-sdk",
"language_2"
]
- },
- {
- "name": "ddc kernel -rnone tests",
- "arguments": [
- "-cdartdevk",
- "-rnone",
- "--checked",
- "--strong",
- "--use-sdk",
- "language_2"
- ]
}
]
},
diff --git a/tools/bots/try_test.dart b/tools/bots/try_test.dart
index 3185e2d..1365fb0 100644
--- a/tools/bots/try_test.dart
+++ b/tools/bots/try_test.dart
@@ -21,18 +21,27 @@
String buildArgs = null;
if (buildType == BuildType.compile) {
- buildArgs = getStepInput("Give the arguments to build.py, seperate by "
+ buildArgs = getStepInput("Give the arguments to build.py, separate by "
"' '");
} else if (buildType == BuildType.existing) {
buildArgs = getStepInput("Input the fileset hash");
}
var testCommands = <TestCommand>[];
- var testCommandString = getStepInput("Write a command to execute. Use ' ' to "
- "separate arguments. If you only wish to build, just press <Enter>");
+ var testCommandString = getStepInput("Write a command to execute after the "
+ "build-step. Use ' ' to separate arguments. If you only wish to build, "
+ "just press <Enter>");
while (testCommandString.isNotEmpty) {
+ if (builderPlatform == Platform.linux) {
+ var useXvfb = getIntegerStepInput(
+ "Should the command be wrapped by xvfb (i.e. is the runtime 'drt', "
+ "'chrome' or 'ff')?: (0) No, (1) Yes");
+ if (useXvfb == 1) {
+ testCommandString = "xvfb $testCommandString";
+ }
+ }
var testCommandRepeat = getIntegerStepInput("How many times would you like "
- "the command '${testCommandString} to be invoked?");
+ "the command '${testCommandString}' to be invoked?");
testCommands.add(new TestCommand(testCommandString, testCommandRepeat));
testCommandString = getStepInput("Write an additional command to execute. "
"Use ' ' to separate arguments. If no additional commands should be run"
@@ -44,7 +53,7 @@
int commandIndex = 1;
var allTestCommands = testCommands
.expand((testCommand) => testCommand.toTryCommand(commandIndex++));
- print("git try cl -b ${getBuilderName(builderPlatform)} "
+ print("git cl try -B luci.dart.try -b ${getBuilderName(builderPlatform)} "
"${getBuildProperties(buildType, buildArgs)}"
"${allTestCommands.join(' ')}");
}
@@ -52,13 +61,13 @@
String getBuilderName(Platform builderPlatform) {
switch (builderPlatform) {
case Platform.linux:
- return "dart-linux-test-try";
+ return "cl-linux-try";
case Platform.win:
- return "dart-win-test-try";
+ return "cl-win-try";
case Platform.mac:
- return "dart-mac-test-try";
+ return "cl-mac-try";
}
- return "dart-linux-test-try";
+ return "cl-linux-try";
}
String getBuildProperties(BuildType buildType, String buildArgs) {
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index 0c84922..c3b8d31 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -597,14 +597,11 @@
String exec = Platform.executable;
var args = [
'--packages=.packages',
- 'pkg/front_end/tool/_fasta/compile.dart',
+ 'pkg/vm/bin/precompiler_kernel_front_end.dart',
'--platform=${buildDir}/vm_platform_strong.dill',
- '--strong-mode',
- '--fatal=errors',
- '--target-options=strong-aot',
+ '-o',
+ tempKernelFile(tempDir),
];
- args.add('-o');
- args.add(tempKernelFile(tempDir));
args.addAll(arguments.where((name) => name.endsWith('.dart')));
return Command.compilation('compile_to_kernel', tempDir,
bootstrapDependencies(), exec, args, environmentOverrides,
diff --git a/utils/application_snapshot.gni b/utils/application_snapshot.gni
index a333f1b..fa28255 100644
--- a/utils/application_snapshot.gni
+++ b/utils/application_snapshot.gni
@@ -39,25 +39,26 @@
}
compiled_action(target_name) {
tool = "$_dart_root/runtime/bin:dart"
- deps = extra_deps + [ "$_dart_root/pkg:pkg_files_stamp" ]
+ deps = extra_deps
+ depfile = "$root_gen_dir/$name.dart.snapshot.d"
- inputs = extra_inputs + [
- "$_dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart",
- "$root_gen_dir/pkg_files.stamp",
- ]
+ main_file = rebase_path(main_dart)
+
+ inputs = extra_inputs + [ main_file ]
output = "$root_gen_dir/$name.dart.snapshot"
outputs = [
output,
]
+ abs_depfile = rebase_path(depfile)
abs_output = rebase_path(output)
- main_file = rebase_path(main_dart)
args = [
"--deterministic",
"--packages=$dot_packages",
"--snapshot=$abs_output",
+ "--snapshot-depfile=$abs_depfile",
]
if (dart_snapshot_kind == "script") {