Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 35c81c5

Browse files
author
Dart CI
committed
Version 2.15.0-50.0.dev
Merge commit '637e14006cfbeb254a14236a419c29034bce01c3' into 'dev'
2 parents 72f462e + 637e140 commit 35c81c5

File tree

91 files changed

+1324
-757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1324
-757
lines changed

pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,26 @@ Message _withArgumentsConstEvalDeferredLibrary(String nameOKEmpty) {
13171317
arguments: {'nameOKEmpty': nameOKEmpty});
13181318
}
13191319

1320+
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
1321+
const Template<Message Function(String string)> templateConstEvalError =
1322+
const Template<Message Function(String string)>(
1323+
messageTemplate: r"""Error evaluating constant expression: #string""",
1324+
withArguments: _withArgumentsConstEvalError);
1325+
1326+
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
1327+
const Code<Message Function(String string)> codeConstEvalError =
1328+
const Code<Message Function(String string)>(
1329+
"ConstEvalError",
1330+
);
1331+
1332+
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
1333+
Message _withArgumentsConstEvalError(String string) {
1334+
if (string.isEmpty) throw 'No string provided';
1335+
return new Message(codeConstEvalError,
1336+
message: """Error evaluating constant expression: ${string}""",
1337+
arguments: {'string': string});
1338+
}
1339+
13201340
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
13211341
const Code<Null> codeConstEvalExtension = messageConstEvalExtension;
13221342

pkg/compiler/lib/src/ir/constants.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,7 @@ class ErrorReporter implements ir.ErrorReporter {
100100
ErrorReporter(this._reportError);
101101

102102
@override
103-
void reportInvalidExpression(ir.InvalidExpression node) {
104-
// Ignore.
105-
}
106-
107-
@override
108-
void report(ir.LocatedMessage message, List<ir.LocatedMessage> context) {
103+
void report(ir.LocatedMessage message, [List<ir.LocatedMessage> context]) {
109104
if (requiresConstant) {
110105
_reportError(message, context);
111106
}

pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6404,8 +6404,12 @@ class BodyBuilder extends ScopeListener<JumpTarget>
64046404
allowPotentiallyConstantType: allowPotentiallyConstantType);
64056405
if (message == null) return unresolved;
64066406
return new UnresolvedType(
6407-
new NamedTypeBuilder(typeParameter.name!, builder.nullabilityBuilder,
6408-
/* arguments = */ null, unresolved.fileUri, unresolved.charOffset)
6407+
new NamedTypeBuilder(
6408+
typeParameter.name!,
6409+
builder.nullabilityBuilder,
6410+
/* arguments = */ null,
6411+
unresolved.fileUri,
6412+
unresolved.charOffset)
64096413
..bind(new InvalidTypeDeclarationBuilder(
64106414
typeParameter.name!, message)),
64116415
unresolved.charOffset,

pkg/front_end/lib/src/fasta/kernel/constant_collection_builders.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ abstract class _ListOrSetConstantBuilder<L extends Expression> {
4444
parts.add(spread);
4545
} else if (spread == evaluator.nullConstant) {
4646
// Null spread
47-
return evaluator.createErrorConstant(
47+
return evaluator.createEvaluationErrorConstant(
4848
spreadExpression, messageConstEvalNullValue);
4949
} else {
5050
// Fully evaluated spread
@@ -67,7 +67,7 @@ abstract class _ListOrSetConstantBuilder<L extends Expression> {
6767
});
6868
} else {
6969
// Not list or set in spread
70-
return evaluator.createErrorConstant(
70+
return evaluator.createEvaluationErrorConstant(
7171
spreadExpression, messageConstEvalNotListOrSetInSpread);
7272
}
7373
for (Constant entry in entries) {
@@ -159,14 +159,14 @@ class SetConstantBuilder extends _ListOrSetConstantBuilder<SetLiteral> {
159159
@override
160160
AbortConstant? addConstant(Constant constant, TreeNode context) {
161161
if (!evaluator.hasPrimitiveEqual(constant)) {
162-
return evaluator.createErrorConstant(
162+
return evaluator.createEvaluationErrorConstant(
163163
context,
164164
templateConstEvalElementImplementsEqual.withArguments(
165165
constant, evaluator.isNonNullableByDefault));
166166
}
167167
bool unseen = seen.add(constant);
168168
if (!unseen) {
169-
return evaluator.createErrorConstant(
169+
return evaluator.createEvaluationErrorConstant(
170170
context,
171171
templateConstEvalDuplicateElement.withArguments(
172172
constant, evaluator.isNonNullableByDefault));
@@ -176,7 +176,7 @@ class SetConstantBuilder extends _ListOrSetConstantBuilder<SetLiteral> {
176176
evaluator._weakener.visitConstant(constant) ?? constant;
177177
bool weakUnseen = weakSeen.add(weakConstant);
178178
if (unseen != weakUnseen) {
179-
return evaluator.createErrorConstant(
179+
return evaluator.createEvaluationErrorConstant(
180180
context, messageNonAgnosticConstant);
181181
}
182182
}
@@ -267,7 +267,7 @@ class MapConstantBuilder {
267267
parts.add(spread);
268268
} else if (spread == evaluator.nullConstant) {
269269
// Null spread
270-
return evaluator.createErrorConstant(
270+
return evaluator.createEvaluationErrorConstant(
271271
spreadExpression, messageConstEvalNullValue);
272272
} else {
273273
// Fully evaluated spread
@@ -286,7 +286,7 @@ class MapConstantBuilder {
286286
if (error != null) return error;
287287
} else {
288288
// Not map in spread
289-
return evaluator.createErrorConstant(
289+
return evaluator.createEvaluationErrorConstant(
290290
spreadExpression, messageConstEvalNotMapInSpread);
291291
}
292292
}
@@ -305,14 +305,14 @@ class MapConstantBuilder {
305305
parts.add(lastPart = <ConstantMapEntry>[]);
306306
}
307307
if (!evaluator.hasPrimitiveEqual(key)) {
308-
return evaluator.createErrorConstant(
308+
return evaluator.createEvaluationErrorConstant(
309309
keyContext,
310310
templateConstEvalKeyImplementsEqual.withArguments(
311311
key, evaluator.isNonNullableByDefault));
312312
}
313313
bool unseenKey = seenKeys.add(key);
314314
if (!unseenKey) {
315-
return evaluator.createErrorConstant(
315+
return evaluator.createEvaluationErrorConstant(
316316
keyContext,
317317
templateConstEvalDuplicateKey.withArguments(
318318
key, evaluator.isNonNullableByDefault));
@@ -321,7 +321,7 @@ class MapConstantBuilder {
321321
Constant weakKey = evaluator._weakener.visitConstant(key) ?? key;
322322
bool weakUnseenKey = weakSeenKeys.add(weakKey);
323323
if (unseenKey != weakUnseenKey) {
324-
return evaluator.createErrorConstant(
324+
return evaluator.createEvaluationErrorConstant(
325325
keyContext, messageNonAgnosticConstant);
326326
}
327327
}

0 commit comments

Comments
 (0)