Skip to content

Commit b2aad7c

Browse files
author
Dart CI
committed
Version 2.19.0-373.0.dev
Merge 6cc1c3c into dev
2 parents 35b0cc8 + 6cc1c3c commit b2aad7c

File tree

257 files changed

+1083
-720
lines changed

Some content is hidden

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

257 files changed

+1083
-720
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ vars = {
5353
# hashes.
5454
"co19_rev": "642b786a850a9de5ab75ce872c98d7d560fe9fc2",
5555
# This line prevents conflicts when both packages are rolled simultaneously.
56-
"co19_2_rev": "6dc80bd1ff15d0854eaba0c7e5d606ec0ad6b3db",
56+
"co19_2_rev": "cdab7e4e26f3dd534bcb297ff3f9e9aa5c7a04fb",
5757

5858
# The internal benchmarks to use. See go/dart-benchmarks-internal
5959
"benchmarks_internal_rev": "599aa474a03c37be146f82dfbad85f34f25ffa47",

pkg/analysis_server/lib/src/analysis_server.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ abstract class AnalysisServer {
429429
var libraryPath = unitElement.element.library.source.fullName;
430430
var result = await currentSession.getResolvedLibrary(libraryPath);
431431
return result is ResolvedLibraryResult ? result : null;
432+
} on InconsistentAnalysisException {
433+
return null;
432434
} catch (exception, stackTrace) {
433435
instrumentationService.logException(exception, stackTrace);
434436
}

pkg/front_end/lib/src/fasta/builder/named_type_builder.dart

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,13 @@ abstract class NamedTypeBuilder extends TypeBuilder {
400400
DartType _buildInternal(
401401
LibraryBuilder library, TypeUse typeUse, ClassHierarchyBase? hierarchy) {
402402
DartType aliasedType = _buildAliasedInternal(library, typeUse, hierarchy);
403+
404+
if (library is SourceLibraryBuilder &&
405+
!isRecordAccessAllowed(library.libraryFeatures) &&
406+
isDartCoreRecord(aliasedType)) {
407+
library.reportFeatureNotEnabled(library.libraryFeatures.records,
408+
fileUri ?? library.fileUri, charOffset!, nameText.length);
409+
}
403410
return unalias(aliasedType,
404411
legacyEraseAliases:
405412
!_performTypeCanonicalization && !library.isNonNullableByDefault);
@@ -412,7 +419,7 @@ abstract class NamedTypeBuilder extends TypeBuilder {
412419
DartType builtType = _buildAliasedInternal(library, typeUse, hierarchy);
413420
if (library is SourceLibraryBuilder &&
414421
!isRecordAccessAllowed(library.libraryFeatures) &&
415-
isRecordOrItsAlias(builtType)) {
422+
isDartCoreRecord(builtType)) {
416423
library.reportFeatureNotEnabled(library.libraryFeatures.records,
417424
fileUri ?? library.fileUri, charOffset!, nameText.length);
418425
}
@@ -704,16 +711,7 @@ class _ExplicitNamedTypeBuilder extends NamedTypeBuilder {
704711
@override
705712
DartType build(LibraryBuilder library, TypeUse typeUse,
706713
{ClassHierarchyBase? hierarchy}) {
707-
DartType builtType = _buildInternal(library, typeUse, hierarchy);
708-
709-
if (library is SourceLibraryBuilder &&
710-
!isRecordAccessAllowed(library.libraryFeatures) &&
711-
isRecordOrItsAlias(builtType)) {
712-
library.reportFeatureNotEnabled(library.libraryFeatures.records,
713-
fileUri ?? library.fileUri, charOffset!, nameText.length);
714-
}
715-
716-
return _type ??= builtType;
714+
return _type ??= _buildInternal(library, typeUse, hierarchy);
717715
}
718716
}
719717

pkg/front_end/lib/src/fasta/incremental_compiler.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,7 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
12411241

12421242
for (Uri uri in builderUris) {
12431243
List<int>? previousSource =
1244-
CompilerContext.current.uriToSource[uri]!.source;
1245-
// ignore: unnecessary_null_comparison
1244+
CompilerContext.current.uriToSource[uri]?.source;
12461245
if (previousSource == null || previousSource.isEmpty) {
12471246
recorderForTesting?.recordAdvancedInvalidationResult(
12481247
AdvancedInvalidationResult.noPreviousSource);

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,11 +2313,6 @@ class BodyBuilder extends StackListenerImpl
23132313
libraryFeatures.patterns, case_.charOffset, case_.charCount);
23142314
Pattern pattern = toPattern(pop());
23152315
Expression expression = popForValue();
2316-
for (VariableDeclaration variable in pattern.declaredVariables) {
2317-
// Skip synthetic variables.
2318-
if (variable.name == null) continue;
2319-
declareVariable(variable, scope);
2320-
}
23212316
push(new Condition(expression, pattern, guard));
23222317
} else {
23232318
assert(checkState(token, [
@@ -3459,10 +3454,20 @@ class BodyBuilder extends StackListenerImpl
34593454
@override
34603455
void beginThenStatement(Token token) {
34613456
debugEvent("beginThenStatement");
3457+
assert(checkState(token, [ValueKinds.Condition]));
34623458
// This is matched by the call to [deferNode] in
34633459
// [endThenStatement].
34643460
typeInferrer.assignedVariables.beginNode();
3461+
Condition condition = peek() as Condition;
34653462
enterLocalScope("then");
3463+
Pattern? pattern = condition.pattern;
3464+
if (pattern != null) {
3465+
for (VariableDeclaration variable in pattern.declaredVariables) {
3466+
// Skip synthetic variables.
3467+
if (variable.name == null) continue;
3468+
declareVariable(variable, scope);
3469+
}
3470+
}
34663471
}
34673472

34683473
@override

0 commit comments

Comments
 (0)