Skip to content

Commit aaca2ac

Browse files
author
Dart CI
committed
Version 2.15.0-221.0.dev
Merge commit 'c9a7ed43d18bf474babc23f3722b7a1a61222a69' into 'dev'
2 parents 82b0281 + c9a7ed4 commit aaca2ac

File tree

42 files changed

+28745
-29147
lines changed

Some content is hidden

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

42 files changed

+28745
-29147
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,12 @@
469469

470470
#### Linter
471471

472-
Updated the Linter to `1.12.0`, which includes changes that
472+
Updated the Linter to `1.13.0`, which includes changes that
473+
- allow `while (true) { ... }` in `literal_only_boolean_expressions`.
474+
- fix `file_names` to report at the start of the file (not the entire
475+
compilation unit).
476+
- fix `prefer_collection_literals` named typed parameter false positives.
477+
- improve control flow analysis for `use_build_context_synchronously`.
473478
- update `avoid_print` to allow `kDebugMode`-wrapped print calls.
474479
- fix handling of initializing formals in `prefer_final_parameters`.
475480
- fix `unnecessary_parenthesis` false positive with function expressions.

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ vars = {
122122
"intl_tag": "0.17.0-nullsafety",
123123
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
124124
"json_rpc_2_rev": "7e00f893440a72de0637970325e4ea44bd1e8c8e",
125-
"linter_tag": "1.12.0",
125+
"linter_tag": "1.13.0",
126126
"lints_tag": "f9670df2a66e0ec12eb51554e70c1cbf56c8f5d0",
127127
"logging_rev": "575781ef196e4fed4fb737e38fb4b73d62727187",
128128
"markupsafe_rev": "8f45f5cfa0009d2a70589bcda0349b8cb2b72783",
@@ -163,7 +163,7 @@ vars = {
163163
"test_reflective_loader_rev": "fcfce37666672edac849d2af6dffc0f8df236a94",
164164
"test_rev": "099dcc4d052a30c6921489cfbefa1c8531d12975",
165165
"typed_data_rev": "29ce5a92b03326d0b8035916ac04f528874994bd",
166-
"usage_rev": "e0780cd8b2f8af69a28dc52678ffe8492da27d06",
166+
"usage_rev": "f0cb8f7cce8b675255c81488dbab8cf9f2f56404",
167167
"vector_math_rev": "0c9f5d68c047813a6dcdeb88ba7a42daddf25025",
168168
"watcher_rev": "3924194385fb215cef483193ed2879a618a3d69c",
169169
"webdriver_rev": "ff5ccb1522edf4bed578ead4d65e0cbc1f2c4f02",

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6446,7 +6446,6 @@ class Parser {
64466446
assert(optional('(', begin));
64476447
listener.beginArguments(begin);
64486448
int argumentCount = 0;
6449-
bool hasSeenNamedArgument = false;
64506449
bool old = mayParseFunctionExpressions;
64516450
mayParseFunctionExpressions = true;
64526451
while (true) {
@@ -6461,10 +6460,6 @@ class Parser {
64616460
ensureIdentifier(token, IdentifierContext.namedArgumentReference)
64626461
.next!;
64636462
colon = token;
6464-
hasSeenNamedArgument = true;
6465-
} else if (hasSeenNamedArgument) {
6466-
// Positional argument after named argument.
6467-
reportRecoverableError(next, codes.messagePositionalAfterNamedArgument);
64686463
}
64696464
token = parseExpression(token);
64706465
next = token.next!;

pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,16 @@ class _ContextTypeVisitor extends SimpleAstVisitor<DartType> {
651651
return null;
652652
}
653653

654+
@override
655+
DartType? visitConstructorName(ConstructorName node) {
656+
return _visitParent(node);
657+
}
658+
659+
@override
660+
DartType? visitConstructorReference(ConstructorReference node) {
661+
return _visitParent(node);
662+
}
663+
654664
@override
655665
DartType? visitDefaultFormalParameter(DefaultFormalParameter node) {
656666
var separator = node.separator;

pkg/analysis_server/test/src/services/completion/dart/feature_computer_test.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,30 @@ class C {
438438
''', 'num');
439439
}
440440

441+
Future<void> test_className_period() async {
442+
await assertContextType('''
443+
int x = List.^;
444+
''', 'int');
445+
}
446+
447+
Future<void> test_className_period_identifier() async {
448+
await assertContextType('''
449+
int x = List.^;
450+
''', 'int');
451+
}
452+
453+
Future<void> test_className_typeArguments_period() async {
454+
await assertContextType('''
455+
int x = List<double>.^;
456+
''', 'int');
457+
}
458+
459+
Future<void> test_className_typeArguments_period_identifier() async {
460+
await assertContextType('''
461+
int x = List<double>.foo^;
462+
''', 'int');
463+
}
464+
441465
Future<void> test_fieldDeclaration_int() async {
442466
await assertContextType('''
443467
class Foo {

pkg/analyzer/lib/src/dart/analysis/dependency/node.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ClassMemberReference {
2222
final int hashCode;
2323

2424
ClassMemberReference(this.target, this.name)
25-
: hashCode = Object.hash(target.hashCode, name.hashCode);
25+
: hashCode = Object.hash(target, name);
2626

2727
@override
2828
bool operator ==(Object other) {
@@ -120,7 +120,7 @@ class LibraryQualifiedName {
120120

121121
factory LibraryQualifiedName(Uri libraryUri, String name) {
122122
var isPrivate = name.startsWith('_');
123-
var hashCode = Object.hash(libraryUri.hashCode, name.hashCode);
123+
var hashCode = Object.hash(libraryUri, name);
124124
return LibraryQualifiedName._internal(
125125
libraryUri, name, isPrivate, hashCode);
126126
}

pkg/analyzer/lib/src/dart/analysis/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ import 'package:meta/meta.dart';
8080
/// TODO(scheglov) Clean up the list of implicitly analyzed files.
8181
class AnalysisDriver implements AnalysisDriverGeneric {
8282
/// The version of data format, should be incremented on every format change.
83-
static const int DATA_VERSION = 187;
83+
static const int DATA_VERSION = 188;
8484

8585
/// The number of exception contexts allowed to write. Once this field is
8686
/// zero, we stop writing any new exception contexts in this process.

pkg/analyzer/lib/src/dart/analysis/experiments.g.dart

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ final _knownFeatures = <String, ExperimentalFeature>{
1717
EnableString.constructor_tearoffs: ExperimentalFeatures.constructor_tearoffs,
1818
EnableString.control_flow_collections:
1919
ExperimentalFeatures.control_flow_collections,
20+
EnableString.enhanced_enums: ExperimentalFeatures.enhanced_enums,
2021
EnableString.extension_methods: ExperimentalFeatures.extension_methods,
2122
EnableString.extension_types: ExperimentalFeatures.extension_types,
2223
EnableString.generic_metadata: ExperimentalFeatures.generic_metadata,
24+
EnableString.named_arguments_anywhere:
25+
ExperimentalFeatures.named_arguments_anywhere,
2326
EnableString.non_nullable: ExperimentalFeatures.non_nullable,
2427
EnableString.nonfunction_type_aliases:
2528
ExperimentalFeatures.nonfunction_type_aliases,
@@ -46,6 +49,9 @@ class EnableString {
4649
/// String to enable the experiment "control-flow-collections"
4750
static const String control_flow_collections = 'control-flow-collections';
4851

52+
/// String to enable the experiment "enhanced-enums"
53+
static const String enhanced_enums = 'enhanced-enums';
54+
4955
/// String to enable the experiment "extension-methods"
5056
static const String extension_methods = 'extension-methods';
5157

@@ -55,6 +61,9 @@ class EnableString {
5561
/// String to enable the experiment "generic-metadata"
5662
static const String generic_metadata = 'generic-metadata';
5763

64+
/// String to enable the experiment "named-arguments-anywhere"
65+
static const String named_arguments_anywhere = 'named-arguments-anywhere';
66+
5867
/// String to enable the experiment "non-nullable"
5968
static const String non_nullable = 'non-nullable';
6069

@@ -123,8 +132,18 @@ class ExperimentalFeatures {
123132
releaseVersion: Version.parse('2.0.0'),
124133
);
125134

126-
static final extension_methods = ExperimentalFeature(
135+
static final enhanced_enums = ExperimentalFeature(
127136
index: 4,
137+
enableString: EnableString.enhanced_enums,
138+
isEnabledByDefault: IsEnabledByDefault.enhanced_enums,
139+
isExpired: IsExpired.enhanced_enums,
140+
documentation: 'Enhanced Enums',
141+
experimentalReleaseVersion: null,
142+
releaseVersion: null,
143+
);
144+
145+
static final extension_methods = ExperimentalFeature(
146+
index: 5,
128147
enableString: EnableString.extension_methods,
129148
isEnabledByDefault: IsEnabledByDefault.extension_methods,
130149
isExpired: IsExpired.extension_methods,
@@ -134,7 +153,7 @@ class ExperimentalFeatures {
134153
);
135154

136155
static final extension_types = ExperimentalFeature(
137-
index: 5,
156+
index: 6,
138157
enableString: EnableString.extension_types,
139158
isEnabledByDefault: IsEnabledByDefault.extension_types,
140159
isExpired: IsExpired.extension_types,
@@ -144,7 +163,7 @@ class ExperimentalFeatures {
144163
);
145164

146165
static final generic_metadata = ExperimentalFeature(
147-
index: 6,
166+
index: 7,
148167
enableString: EnableString.generic_metadata,
149168
isEnabledByDefault: IsEnabledByDefault.generic_metadata,
150169
isExpired: IsExpired.generic_metadata,
@@ -154,8 +173,18 @@ class ExperimentalFeatures {
154173
releaseVersion: Version.parse('2.14.0'),
155174
);
156175

176+
static final named_arguments_anywhere = ExperimentalFeature(
177+
index: 8,
178+
enableString: EnableString.named_arguments_anywhere,
179+
isEnabledByDefault: IsEnabledByDefault.named_arguments_anywhere,
180+
isExpired: IsExpired.named_arguments_anywhere,
181+
documentation: 'Named Arguments Anywhere',
182+
experimentalReleaseVersion: null,
183+
releaseVersion: null,
184+
);
185+
157186
static final non_nullable = ExperimentalFeature(
158-
index: 7,
187+
index: 9,
159188
enableString: EnableString.non_nullable,
160189
isEnabledByDefault: IsEnabledByDefault.non_nullable,
161190
isExpired: IsExpired.non_nullable,
@@ -165,7 +194,7 @@ class ExperimentalFeatures {
165194
);
166195

167196
static final nonfunction_type_aliases = ExperimentalFeature(
168-
index: 8,
197+
index: 10,
169198
enableString: EnableString.nonfunction_type_aliases,
170199
isEnabledByDefault: IsEnabledByDefault.nonfunction_type_aliases,
171200
isExpired: IsExpired.nonfunction_type_aliases,
@@ -175,7 +204,7 @@ class ExperimentalFeatures {
175204
);
176205

177206
static final set_literals = ExperimentalFeature(
178-
index: 9,
207+
index: 11,
179208
enableString: EnableString.set_literals,
180209
isEnabledByDefault: IsEnabledByDefault.set_literals,
181210
isExpired: IsExpired.set_literals,
@@ -185,7 +214,7 @@ class ExperimentalFeatures {
185214
);
186215

187216
static final spread_collections = ExperimentalFeature(
188-
index: 10,
217+
index: 12,
189218
enableString: EnableString.spread_collections,
190219
isEnabledByDefault: IsEnabledByDefault.spread_collections,
191220
isExpired: IsExpired.spread_collections,
@@ -195,7 +224,7 @@ class ExperimentalFeatures {
195224
);
196225

197226
static final test_experiment = ExperimentalFeature(
198-
index: 11,
227+
index: 13,
199228
enableString: EnableString.test_experiment,
200229
isEnabledByDefault: IsEnabledByDefault.test_experiment,
201230
isExpired: IsExpired.test_experiment,
@@ -206,7 +235,7 @@ class ExperimentalFeatures {
206235
);
207236

208237
static final triple_shift = ExperimentalFeature(
209-
index: 12,
238+
index: 14,
210239
enableString: EnableString.triple_shift,
211240
isEnabledByDefault: IsEnabledByDefault.triple_shift,
212241
isExpired: IsExpired.triple_shift,
@@ -216,7 +245,7 @@ class ExperimentalFeatures {
216245
);
217246

218247
static final value_class = ExperimentalFeature(
219-
index: 13,
248+
index: 15,
220249
enableString: EnableString.value_class,
221250
isEnabledByDefault: IsEnabledByDefault.value_class,
222251
isExpired: IsExpired.value_class,
@@ -226,7 +255,7 @@ class ExperimentalFeatures {
226255
);
227256

228257
static final variance = ExperimentalFeature(
229-
index: 14,
258+
index: 16,
230259
enableString: EnableString.variance,
231260
isEnabledByDefault: IsEnabledByDefault.variance,
232261
isExpired: IsExpired.variance,
@@ -251,6 +280,9 @@ class IsEnabledByDefault {
251280
/// Default state of the experiment "control-flow-collections"
252281
static const bool control_flow_collections = true;
253282

283+
/// Default state of the experiment "enhanced-enums"
284+
static const bool enhanced_enums = false;
285+
254286
/// Default state of the experiment "extension-methods"
255287
static const bool extension_methods = true;
256288

@@ -260,6 +292,9 @@ class IsEnabledByDefault {
260292
/// Default state of the experiment "generic-metadata"
261293
static const bool generic_metadata = true;
262294

295+
/// Default state of the experiment "named-arguments-anywhere"
296+
static const bool named_arguments_anywhere = false;
297+
263298
/// Default state of the experiment "non-nullable"
264299
static const bool non_nullable = true;
265300

@@ -301,6 +336,9 @@ class IsExpired {
301336
/// Expiration status of the experiment "control-flow-collections"
302337
static const bool control_flow_collections = true;
303338

339+
/// Expiration status of the experiment "enhanced-enums"
340+
static const bool enhanced_enums = false;
341+
304342
/// Expiration status of the experiment "extension-methods"
305343
static const bool extension_methods = false;
306344

@@ -310,6 +348,9 @@ class IsExpired {
310348
/// Expiration status of the experiment "generic-metadata"
311349
static const bool generic_metadata = false;
312350

351+
/// Expiration status of the experiment "named-arguments-anywhere"
352+
static const bool named_arguments_anywhere = false;
353+
313354
/// Expiration status of the experiment "non-nullable"
314355
static const bool non_nullable = false;
315356

@@ -351,6 +392,9 @@ mixin _CurrentState {
351392
bool get control_flow_collections =>
352393
isEnabled(ExperimentalFeatures.control_flow_collections);
353394

395+
/// Current state for the flag "enhanced-enums"
396+
bool get enhanced_enums => isEnabled(ExperimentalFeatures.enhanced_enums);
397+
354398
/// Current state for the flag "extension-methods"
355399
bool get extension_methods =>
356400
isEnabled(ExperimentalFeatures.extension_methods);
@@ -361,6 +405,10 @@ mixin _CurrentState {
361405
/// Current state for the flag "generic-metadata"
362406
bool get generic_metadata => isEnabled(ExperimentalFeatures.generic_metadata);
363407

408+
/// Current state for the flag "named-arguments-anywhere"
409+
bool get named_arguments_anywhere =>
410+
isEnabled(ExperimentalFeatures.named_arguments_anywhere);
411+
364412
/// Current state for the flag "non-nullable"
365413
bool get non_nullable => isEnabled(ExperimentalFeatures.non_nullable);
366414

pkg/analyzer/lib/src/dart/constant/value.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class DartObjectImpl implements DartObject {
184184
Map<String, DartObjectImpl>? get fields => _state.fields;
185185

186186
@override
187-
int get hashCode => Object.hash(type.hashCode, _state.hashCode);
187+
int get hashCode => Object.hash(type, _state);
188188

189189
@override
190190
bool get hasKnownValue => !_state.isUnknown;

pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ class Name {
884884

885885
factory Name(Uri? libraryUri, String name) {
886886
if (name.startsWith('_')) {
887-
var hashCode = Object.hash(libraryUri.hashCode, name.hashCode);
887+
var hashCode = Object.hash(libraryUri, name);
888888
return Name._internal(libraryUri, name, false, hashCode);
889889
} else {
890890
return Name._internal(null, name, true, name.hashCode);

0 commit comments

Comments
 (0)