Skip to content

Commit 88d7794

Browse files
author
Dart CI
committed
Version 2.19.0-28.0.dev
Merge commit 'a13ef8a5d5e96e1176488c66797181377389bbc3' into 'dev'
2 parents cd17fe1 + a13ef8a commit 88d7794

File tree

16 files changed

+174
-149
lines changed

16 files changed

+174
-149
lines changed

pkg/_fe_analyzer_shared/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: _fe_analyzer_shared
2-
version: 41.0.0
2+
version: 42.0.0
33
description: Logic that is shared between the front_end and analyzer packages.
44
repository: https://github.com/dart-lang/sdk/tree/main/pkg/_fe_analyzer_shared
55

pkg/analyzer/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## 4.3.0-dev
1+
## 4.3.0
22
* Deprecated `Directive.keyword`, use corresponding `xyzToken` in specific directives.
33
* Deprecated `LibraryElement.parts`, use `parts2` instead.
4-
* Deprecated `LibraryElement.exports`, use `libraryexports` instead.
4+
* Deprecated `LibraryElement.exports`, use `libraryExports` instead.
55
* Deprecated `LibraryElement.imports`, use `libraryImports` instead.
66
* Deprecated `Element.enclosingElement`, use `enclosingElement2` instead.
77
* `Member` is not equal to `ElementImpl`, use `Element.declaration`.

pkg/analyzer/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: analyzer
2-
version: 4.3.0-dev
2+
version: 4.3.0
33
description: This package provides a library that performs static analysis of Dart code.
44
repository: https://github.com/dart-lang/sdk/tree/main/pkg/analyzer
55

66
environment:
77
sdk: '>=2.17.0 <3.0.0'
88

99
dependencies:
10-
_fe_analyzer_shared: ^41.0.0
10+
_fe_analyzer_shared: ^42.0.0
1111
collection: ^1.15.0
1212
convert: ^3.0.0
1313
crypto: ^3.0.0

pkg/compiler/lib/src/inferrer/powersets/powerset_bits.dart

Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart = 2.10
6-
75
import '../../common/elements.dart' show CommonElements;
86
import '../../constants/values.dart';
97
import '../../elements/entities.dart';
108
import '../../elements/names.dart';
119
import '../../elements/types.dart';
1210
import '../../ir/class_relation.dart';
1311
import '../../universe/selector.dart';
14-
import '../../world.dart';
12+
import '../../world_interfaces.dart';
1513
import '../abstract_value_domain.dart';
1614

1715
/// This class is used to store bits information about class entities.
@@ -172,7 +170,7 @@ class PowersetBitsDomain {
172170

173171
// TODO(coam): This currently returns null if we are not sure if it's a primitive.
174172
// It could be improved because we can also tell when we're certain it's not a primitive.
175-
PrimitiveConstantValue getPrimitiveValue(int value) {
173+
PrimitiveConstantValue? getPrimitiveValue(int value) {
176174
if (isDefinitelyTrue(value)) {
177175
return TrueConstantValue();
178176
}
@@ -355,7 +353,7 @@ class PowersetBitsDomain {
355353
}
356354

357355
ClassInfo _computeClassInfo(ClassEntity cls) {
358-
ClassInfo classInfo = _storedClassInfo[cls];
356+
ClassInfo? classInfo = _storedClassInfo[cls];
359357
if (classInfo != null) {
360358
return classInfo;
361359
}
@@ -442,7 +440,10 @@ class PowersetBitsDomain {
442440
}
443441

444442
int createFromStaticType(DartType type,
445-
{ClassRelation classRelation = ClassRelation.subtype, bool nullable}) {
443+
{ClassRelation classRelation = ClassRelation.subtype,
444+
required bool nullable}) {
445+
// TODO(48820): Remove after sound null safety is enabled.
446+
// ignore: unnecessary_null_comparison
446447
assert(nullable != null);
447448

448449
if ((classRelation == ClassRelation.subtype ||
@@ -481,8 +482,6 @@ class PowersetBitsDomain {
481482

482483
int _createFromStaticType(
483484
DartType type, ClassRelation classRelation, bool nullable) {
484-
assert(nullable != null);
485-
486485
int finish(int value, bool isPrecise) {
487486
// [isPrecise] is ignored since we only treat singleton partitions as
488487
// precise.
@@ -576,26 +575,21 @@ class PowersetBitsDomain {
576575

577576
int get emptyType => powersetBottom;
578577

579-
int _constMapType;
580-
int get constMapType => _constMapType ??=
578+
late final int constMapType =
581579
createNonNullSubtype(commonElements.constMapLiteralClass);
582580

583581
int get constSetType => otherValue;
584582

585-
int _constListType;
586-
int get constListType => _constListType ??=
583+
late final int constListType =
587584
createNonNullExact(commonElements.jsUnmodifiableArrayClass);
588585

589-
int _fixedListType;
590-
int get fixedListType =>
591-
_fixedListType ??= createNonNullExact(commonElements.jsFixedArrayClass);
586+
late final int fixedListType =
587+
createNonNullExact(commonElements.jsFixedArrayClass);
592588

593-
int _growableListType;
594-
int get growableListType => _growableListType ??=
589+
late final int growableListType =
595590
createNonNullExact(commonElements.jsExtendableArrayClass);
596591

597-
int _mutableArrayType;
598-
int get mutableArrayType => _mutableArrayType ??=
592+
late final int mutableArrayType =
599593
createNonNullSubtype(commonElements.jsMutableArrayClass);
600594

601595
int get nullType => nullValue;
@@ -605,43 +599,30 @@ class PowersetBitsDomain {
605599
// TODO(fishythefish): Support tracking late sentinels in the powerset domain.
606600
int get lateSentinelType => powersetBottom;
607601

608-
int _mapType;
609-
int get mapType =>
610-
_mapType ??= createNonNullSubtype(commonElements.mapLiteralClass);
602+
late final int mapType = createNonNullSubtype(commonElements.mapLiteralClass);
611603

612-
int _setType;
613-
int get setType =>
614-
_setType ??= createNonNullSubtype(commonElements.setLiteralClass);
604+
late final int setType = createNonNullSubtype(commonElements.setLiteralClass);
615605

616-
int _listType;
617-
int get listType =>
618-
_listType ??= createNonNullExact(commonElements.jsArrayClass);
606+
late final int listType = createNonNullExact(commonElements.jsArrayClass);
619607

620-
int _stringType;
621-
int get stringType =>
622-
_stringType ??= createNonNullSubtype(commonElements.jsStringClass);
608+
late final int stringType =
609+
createNonNullSubtype(commonElements.jsStringClass);
623610

624-
int _numType;
625-
int get numType =>
626-
_numType ??= createNonNullSubclass(commonElements.jsNumberClass);
611+
late final int numType = createNonNullSubclass(commonElements.jsNumberClass);
627612

628-
int _numNotIntType;
629-
int get numNotIntType =>
630-
_numNotIntType ??= createNonNullExact(commonElements.jsNumNotIntClass);
613+
late final int numNotIntType =
614+
createNonNullExact(commonElements.jsNumNotIntClass);
631615

632-
int _intType;
633-
int get intType =>
634-
_intType ??= createNonNullSubtype(commonElements.jsIntClass);
616+
late final int intType = createNonNullSubtype(commonElements.jsIntClass);
635617

636618
int get positiveIntType => intType;
637619
int get uint32Type => intType;
638620
int get uint31Type => intType;
639621

640622
int get boolType => boolValue;
641623

642-
int _functionType;
643-
int get functionType =>
644-
_functionType ??= createNonNullSubtype(commonElements.functionClass);
624+
late final int functionType =
625+
createNonNullSubtype(commonElements.functionClass);
645626

646627
int get typeType => otherValue;
647628
}

pkg/compiler/lib/src/js_backend/codegen_listener.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart = 2.10
6-
75
library js_backend.backend.codegen_listener;
86

97
import 'dart:collection';
@@ -101,7 +99,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
10199

102100
@override
103101
void onQueueOpen(
104-
Enqueuer enqueuer, FunctionEntity mainMethod, Iterable<Uri> libraries) {
102+
Enqueuer enqueuer, FunctionEntity? mainMethod, Iterable<Uri> libraries) {
105103
enqueuer.applyImpact(_nativeEnqueuer.processNativeClasses(libraries));
106104
if (mainMethod != null) {
107105
enqueuer.applyImpact(_computeMainImpact(mainMethod));
@@ -178,8 +176,8 @@ class CodegenEnqueuerListener extends EnqueuerListener {
178176
.registerTypeUse(TypeUse.instantiation(_commonElements.typeType));
179177
// If the type is a web component, we need to ensure the constructors are
180178
// available to 'upgrade' the native object.
181-
if (constant.representedType is InterfaceType) {
182-
InterfaceType representedType = constant.representedType;
179+
final representedType = constant.representedType;
180+
if (representedType is InterfaceType) {
183181
_customElementsAnalysis.registerTypeConstant(representedType.element);
184182
}
185183
} else if (constant is InstantiationConstantValue) {
@@ -228,10 +226,10 @@ class CodegenEnqueuerListener extends EnqueuerListener {
228226
_customElementsAnalysis.registerStaticUse(member);
229227

230228
if (member.isFunction && member.isInstanceMember) {
231-
ClassEntity cls = member.enclosingClass;
229+
ClassEntity cls = member.enclosingClass!;
232230
if (member.name == Identifiers.call &&
233231
_elementEnvironment.isGenericClass(cls) &&
234-
_rtiNeed.methodNeedsSignature(member)) {
232+
_rtiNeed.methodNeedsSignature(member as FunctionEntity)) {
235233
worldImpact.addImpact(_registerComputeSignature());
236234
}
237235
}

pkg/compiler/lib/src/resolution/enqueuer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ResolutionEnqueuer extends Enqueuer {
3535

3636
final Set<ClassEntity> _recentClasses = Setlet<ClassEntity>();
3737
bool _recentConstants = false;
38-
final ResolutionWorldBuilderForEnqueuer worldBuilder;
38+
final ResolutionWorldBuilder worldBuilder;
3939
WorkItemBuilder? _workItemBuilder;
4040
final DiagnosticReporter _reporter;
4141
final AnnotationsData _annotationsData;

pkg/compiler/lib/src/universe/resolution_world_builder.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class InstantiationInfo {
193193
}
194194

195195
class ResolutionWorldBuilder extends WorldBuilder
196-
implements World, interfaces.ResolutionWorldBuilderForEnqueuer {
196+
implements World, interfaces.ResolutionWorldBuilder {
197197
/// Instantiation information for all classes with instantiated types.
198198
///
199199
/// Invariant: Elements are declaration elements.
@@ -921,6 +921,7 @@ class ResolutionWorldBuilder extends WorldBuilder
921921
/// Here `A.m` is inherited into `A`, `B`, and `C`. Because `B` and
922922
/// `C` implement `I`, `isInheritedInSubtypeOf(A.m, I)` is true, but
923923
/// `isInheritedInSubtypeOf(A.m, J)` is false.
924+
@override
924925
bool isInheritedIn(
925926
MemberEntity member, ClassEntity type, ClassRelation relation) {
926927
// TODO(johnniwinther): Use the [member] itself to avoid enqueueing members

pkg/compiler/lib/src/universe/resolution_world_builder_interfaces.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
import '../elements/entities.dart';
66
import '../elements/types.dart';
7+
import '../ir/class_relation.dart';
78
import 'member_usage.dart';
89
import 'use.dart';
10+
import '../world_interfaces.dart';
911

10-
abstract class ResolutionWorldBuilderForEnqueuer {
12+
abstract class ResolutionWorldBuilder implements World {
1113
Iterable<ClassEntity> get directlyInstantiatedClasses;
1214

1315
Iterable<MemberEntity> get processedMembers;
@@ -19,6 +21,9 @@ abstract class ResolutionWorldBuilderForEnqueuer {
1921
void processClassMembers(ClassEntity cls, MemberUsedCallback memberUsed,
2022
{bool checkEnqueuerConsistency = false});
2123

24+
bool isInheritedIn(
25+
MemberEntity member, ClassEntity type, ClassRelation relation);
26+
2227
void registerDynamicUse(DynamicUse dynamicUse, MemberUsedCallback memberUsed);
2328

2429
bool registerConstantUse(ConstantUse use);

0 commit comments

Comments
 (0)