Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21cb5c1

Browse files
author
Dart CI
committed
Version 3.0.0-134.0.dev
Merge ef147e4 into dev
2 parents 9da75f9 + ef147e4 commit 21cb5c1

File tree

228 files changed

+7668
-1194
lines changed

Some content is hidden

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

228 files changed

+7668
-1194
lines changed

DEPS

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ vars = {
125125
# For more details, see https://github.com/dart-lang/sdk/issues/30164.
126126
"dart_style_rev": "d0c6b1da52c9f80679a7aaa05e5935ef5c6bb52f", # manually rev'd
127127

128-
"dartdoc_rev": "c4ab68247fd40071bc7303c61fc180a57ab086df",
128+
"dartdoc_rev": "a99abd4ba40758dffdb112b725b7a96c16345684",
129129
"devtools_rev": "dd3fade2bd2ef74fc6102e56333a48f0efc594d3",
130130
"ffi_rev": "2a56c2a9a87122c057168874bde384debbb806b0",
131131
"file_rev": "b768f79dcd104a5feabafab47101c4355b71cd8f",
@@ -134,9 +134,9 @@ vars = {
134134
"html_rev": "3dd00b0ca99e222697e6b6dc653774dc877da420",
135135
"http_multi_server_rev": "cce50802b66d33f703f82b3189988aa8e51976ac",
136136
"http_parser_rev": "6f73e4a399df013ded8f4c81f151d122b36d361b",
137-
"http_rev": "d434d42b4c0a75fb3f4170899e9a30265487fbba",
137+
"http_rev": "c955c7e33cc7b02e10f8fded071272d541518cdd",
138138
"icu_rev": "81d656878ec611cb0b42d52c82e9dae93920d9ba",
139-
"intl_rev": "c61fdd19c5a1a72b60d58152e2860f08725d188b",
139+
"intl_rev": "6140b600b3fd42d86e289f7d92c18488fe7e4bb9",
140140
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
141141
"json_rpc_2_rev": "bd9f8d90ec9ce9d0da5c11f3e71b87af3aaca3b4",
142142
"linter_rev": "8f7b75f8a3501ca2c4d5bbc1f003d90d66447544", # 1.32.0 (avoid_field_initializers_in_const_classes cherry-pick)
@@ -145,7 +145,7 @@ vars = {
145145
"markdown_rev": "ee3f4e976efcfed87c6ec78364bc2dd3c6e717b9", # https://github.com/dart-lang/markdown/pull/494
146146
"markupsafe_rev": "8f45f5cfa0009d2a70589bcda0349b8cb2b72783",
147147
"matcher_rev": "deedda179c33b00b3e06aa107ebfc3dd2f8a5f49",
148-
"mime_rev": "273d454711487fe00849c2bf3dff189278fd0e6f",
148+
"mime_rev": "034471a60d5603a6988de6d9811bee1cb0657f70",
149149
"mockito_rev": "9cc958a991dc6d6b563196893a77973eee58603c",
150150
"package_config_rev": "2e1a8eca1ebeac01f45003642c25e24e63d45b50",
151151
"path_rev": "9768908ef81cf92fc77cb259c2cf01ca8725de88",
@@ -162,21 +162,21 @@ vars = {
162162
"sse_rev": "be426a2467108d88354dc36a44493d2d17019993",
163163
"stack_trace_rev": "c08ee90b83380381a893d1e77a9a533d632f40e0",
164164
"stream_channel_rev": "3b9926876dc06970b583c34d0cb359ef976c4350",
165-
"string_scanner_rev": "c58618df0f17cbed664b3868c949abb13491e4d3",
166-
"sync_http_rev": "86226142aed0899792b7a0fa1ec491e03425aba3",
165+
"string_scanner_rev": "045498024df8f0a1cd0f717f12d60aec77d3d8ae",
166+
"sync_http_rev": "36a1bd086798cbdb48e7541b05e5a14b5e5bb56b",
167167
"term_glyph_rev": "8cd931827bc3bfc1c62fd7ea44cbbc99b8a94f4d",
168168
"test_descriptor_rev": "b73c691c4e38e23bf8383148d3d68fa65e4a57e9",
169169
"test_process_rev": "62ea2ba786d9e0e7cccedaf305d3972ee41fbc6a",
170170
"test_reflective_loader_rev": "cf58259b91c4d3cccc90abd4c0b44273e6421646",
171-
"test_rev": "932a652bea3f8b95848effb23247acf2bdf35a09",
171+
"test_rev": "43fd92843c5d3cb43dede2b971c69923d9f7308c",
172172
"typed_data_rev": "9c209b9c99ca7528a45c23d5d09579788b3ea81b",
173173
"usage_rev": "2773c7d334db9a902582feb8c5f38899c83d7b54",
174174
"vector_math_rev": "1eee95b15e5d35cf519514cc253037b19705fb7a",
175175
"watcher_rev": "3b49c7ea087cc158bdcba19fe8919283fdc1cd86",
176176
"web_components_rev": "8f57dac273412a7172c8ade6f361b407e2e4ed02",
177177
"web_socket_channel_rev": "28d7b82986cf931e6d977d973a7849cfc7c0bab9",
178178
"WebCore_rev": "bcb10901266c884e7b3740abc597ab95373ab55c",
179-
"webdev_rev": "094ee97b59048d64d5519e6c9e8072cc1bf914dc",
179+
"webdev_rev": "f978b90cdfc97967b8caec1b5e2a4919ce9fa3d2",
180180
"webdriver_rev": "b8c7bb5f57075e7c4215209c14d3e0a8767bf887",
181181
"webkit_inspection_protocol_rev": "15244ffbab9221f1603eb04eaae74ae7c7ca3944",
182182
"yaml_edit_rev": "299f74594ff9fda412c1da5c0b5d5231d0c6fc42",

pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,18 +2178,19 @@ class FlowModel<Type extends Object> {
21782178
FlowModel<Type> write<Variable extends Object>(
21792179
FlowModelHelper<Type> helper,
21802180
NonPromotionReason? nonPromotionReason,
2181-
Variable variable,
21822181
int variableKey,
21832182
Type writtenType,
21842183
SsaNode<Type> newSsaNode,
21852184
Operations<Variable, Type> operations,
2186-
{bool promoteToTypeOfInterest = true}) {
2185+
{bool promoteToTypeOfInterest = true,
2186+
required Type unpromotedType}) {
21872187
FlowModel<Type>? newModel;
21882188
VariableModel<Type>? infoForVar = variableInfo[variableKey];
21892189
if (infoForVar != null) {
2190-
VariableModel<Type> newInfoForVar = infoForVar.write(nonPromotionReason,
2191-
variable, variableKey, writtenType, operations, newSsaNode,
2192-
promoteToTypeOfInterest: promoteToTypeOfInterest);
2190+
VariableModel<Type> newInfoForVar = infoForVar.write(
2191+
nonPromotionReason, variableKey, writtenType, operations, newSsaNode,
2192+
promoteToTypeOfInterest: promoteToTypeOfInterest,
2193+
unpromotedType: unpromotedType);
21932194
if (!identical(newInfoForVar, infoForVar)) {
21942195
newModel = _updateVariableInfo(variableKey, newInfoForVar);
21952196
}
@@ -2863,12 +2864,12 @@ class VariableModel<Type extends Object> {
28632864
/// reason for any potential demotion.
28642865
VariableModel<Type> write<Variable extends Object>(
28652866
NonPromotionReason? nonPromotionReason,
2866-
Variable variable,
28672867
int variableKey,
28682868
Type writtenType,
28692869
Operations<Variable, Type> operations,
28702870
SsaNode<Type> newSsaNode,
2871-
{required bool promoteToTypeOfInterest}) {
2871+
{required bool promoteToTypeOfInterest,
2872+
required Type unpromotedType}) {
28722873
if (writeCaptured) {
28732874
return new VariableModel<Type>(
28742875
promotedTypes: promotedTypes,
@@ -2882,10 +2883,9 @@ class VariableModel<Type extends Object> {
28822883
_demoteViaAssignment(writtenType, operations, nonPromotionReason);
28832884
List<Type>? newPromotedTypes = demotionResult.promotedTypes;
28842885

2885-
Type declaredType = operations.variableType(variable);
28862886
if (promoteToTypeOfInterest) {
28872887
newPromotedTypes = _tryPromoteToTypeOfInterest(
2888-
operations, declaredType, newPromotedTypes, writtenType);
2888+
operations, unpromotedType, newPromotedTypes, writtenType);
28892889
}
28902890
// TODO(paulberry): remove demotions from demotionResult.nonPromotionHistory
28912891
// that are no longer in effect due to re-promotion.
@@ -3949,6 +3949,7 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
39493949
{required bool isFinal,
39503950
required bool isLate,
39513951
required bool isImplicitlyTyped}) {
3952+
Type unpromotedType = operations.variableType(variable);
39523953
int variableKey = promotionKeyStore.keyForVariable(variable);
39533954
ExpressionInfo<Type>? expressionInfo;
39543955
if (isLate) {
@@ -3965,12 +3966,13 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
39653966
SsaNode<Type> newSsaNode = new SsaNode<Type>(
39663967
expressionInfo is _TrivialExpressionInfo ? null : expressionInfo);
39673968
_current = _current.write(
3968-
this, null, variable, variableKey, matchedType, newSsaNode, operations,
3969-
promoteToTypeOfInterest: !isImplicitlyTyped && !isFinal);
3969+
this, null, variableKey, matchedType, newSsaNode, operations,
3970+
promoteToTypeOfInterest: !isImplicitlyTyped && !isFinal,
3971+
unpromotedType: unpromotedType);
39703972
if (isImplicitlyTyped && operations.isTypeParameterType(matchedType)) {
39713973
_current = _current
3972-
.tryPromoteForTypeCheck(
3973-
this, _variableReference(variable, variableKey), matchedType)
3974+
.tryPromoteForTypeCheck(this,
3975+
_variableReference(variableKey, unpromotedType), matchedType)
39743976
.ifTrue;
39753977
}
39763978
}
@@ -4436,11 +4438,12 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
44364438

44374439
@override
44384440
Type? variableRead(Expression expression, Variable variable) {
4441+
Type unpromotedType = operations.variableType(variable);
44394442
int variableKey = promotionKeyStore.keyForVariable(variable);
44404443
VariableModel<Type> variableModel = _current._getInfo(variableKey);
44414444
Type? promotedType = variableModel.promotedTypes?.last;
44424445
_storeExpressionReference(
4443-
expression, _variableReference(variable, variableKey));
4446+
expression, _variableReference(variableKey, unpromotedType));
44444447
ExpressionInfo<Type>? expressionInfo = variableModel.ssaNode?.expressionInfo
44454448
?.rebaseForward(operations, _current);
44464449
if (expressionInfo != null) {
@@ -4505,6 +4508,7 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
45054508
@override
45064509
void write(Node node, Variable variable, Type writtenType,
45074510
Expression? writtenExpression) {
4511+
Type unpromotedType = operations.variableType(variable);
45084512
int variableKey = promotionKeyStore.keyForVariable(variable);
45094513
ExpressionInfo<Type>? expressionInfo = writtenExpression == null
45104514
? null
@@ -4514,11 +4518,11 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
45144518
_current = _current.write(
45154519
this,
45164520
new DemoteViaExplicitWrite<Variable>(variable, node),
4517-
variable,
45184521
variableKey,
45194522
writtenType,
45204523
newSsaNode,
4521-
operations);
4524+
operations,
4525+
unpromotedType: unpromotedType);
45224526
}
45234527

45244528
@override
@@ -4775,9 +4779,9 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
47754779
isPromotable: false, isThisOrSuper: true);
47764780

47774781
ReferenceWithType<Type> _variableReference(
4778-
Variable variable, int variableKey) =>
4782+
int variableKey, Type unpromotedType) =>
47794783
new ReferenceWithType<Type>(variableKey,
4780-
promotedType(variable) ?? operations.variableType(variable),
4784+
_current.infoFor(variableKey).promotedTypes?.last ?? unpromotedType,
47814785
isPromotable: true, isThisOrSuper: false);
47824786
}
47834787

pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ class ExtensionShowHideElementIdentifierContext extends IdentifierContext {
447447
}
448448

449449
@override
450-
bool operator ==(Object other) {
450+
bool operator ==(dynamic other) {
451451
return other is ExtensionShowHideElementIdentifierContext &&
452452
_kind == other._kind;
453453
}

pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,8 +1107,8 @@ mixin TypeAnalyzer<
11071107
flow.patternForIn_end();
11081108
}
11091109

1110-
/// Analyzes a patternVariableDeclaration statement of the form
1111-
/// `var pattern = initializer;` or `final pattern = initializer;.
1110+
/// Analyzes a patternVariableDeclaration node of the form
1111+
/// `var pattern = initializer` or `final pattern = initializer`.
11121112
///
11131113
/// [node] should be the AST node for the entire declaration, [pattern] for
11141114
/// the pattern, and [initializer] for the initializer. [isFinal] and
@@ -1120,7 +1120,7 @@ mixin TypeAnalyzer<
11201120
/// reported if any other kind of pattern is used.
11211121
///
11221122
/// Stack effect: pushes (Expression, Pattern).
1123-
void analyzePatternVariableDeclarationStatement(
1123+
void analyzePatternVariableDeclaration(
11241124
Node node, Pattern pattern, Expression initializer,
11251125
{required bool isFinal, required bool isLate}) {
11261126
// Stack: ()

pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7309,12 +7309,7 @@ extension on FlowModel<Type> {
73097309
Var variable,
73107310
Type writtenType,
73117311
SsaNode<Type> newSsaNode) =>
7312-
write(
7313-
h,
7314-
nonPromotionReason,
7315-
variable,
7316-
h.promotionKeyStore.keyForVariable(variable),
7317-
writtenType,
7318-
newSsaNode,
7319-
h.typeOperations);
7312+
write(h, nonPromotionReason, h.promotionKeyStore.keyForVariable(variable),
7313+
writtenType, newSsaNode, h.typeOperations,
7314+
unpromotedType: variable.type);
73207315
}

0 commit comments

Comments
 (0)