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

Commit a9cfcc2

Browse files
author
Dart CI
committed
Version 2.17.0-94.0.dev
Merge commit '4fb3d2afcf424ff3f73d55fc1585c448cdaa8762' into 'dev'
2 parents 7e3310b + 4fb3d2a commit a9cfcc2

File tree

245 files changed

+2523
-2977
lines changed

Some content is hidden

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

245 files changed

+2523
-2977
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ vars = {
115115
"fixnum_rev": "848341f061359ef7ddc0cad472c2ecbb036b28ac",
116116
"file_rev": "0e09370f581ab6388d46fda4cdab66638c0171a1",
117117
"glob_rev": "da1f4595ee2f87982cbcc663d4cac244822d9227",
118-
"html_rev": "00cd3c22dac0e68e6ed9e7e4945101aedb1b3109",
118+
"html_rev": "3c2448108b431dd00d3a7033d9f43f19fa5d93d3",
119119
"http_io_rev": "2fa188caf7937e313026557713f7feffedd4978b",
120120
"http_multi_server_rev": "34bf7f04b61cce561f47f7f275c2cc811534a05a",
121121
"http_parser_rev": "202391286ddc13c4c3c284ac5b511f04697250ed",

pkg/analysis_server/lib/src/protocol_server.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ SearchResultKind newSearchResultKind_fromEngine(engine.MatchKind kind) {
242242
if (kind == engine.MatchKind.WRITE) {
243243
return SearchResultKind.WRITE;
244244
}
245-
if (kind == engine.MatchKind.INVOCATION) {
245+
if (kind == engine.MatchKind.INVOCATION ||
246+
kind == engine.MatchKind.INVOCATION_BY_ENUM_CONSTANT_WITHOUT_ARGUMENTS) {
246247
return SearchResultKind.INVOCATION;
247248
}
248249
if (kind == engine.MatchKind.REFERENCE ||

pkg/analysis_server/lib/src/services/correction/dart/make_variable_nullable.dart

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class MakeVariableNullable extends CorrectionProducer {
3838
await _forFunctionTypedFormalParameter(builder, node, parent);
3939
} else if (node is SimpleIdentifier && parent is FieldFormalParameter) {
4040
await _forFieldFormalParameter(builder, node, parent);
41+
} else if (node is SimpleIdentifier && parent is SuperFormalParameter) {
42+
await _forSuperFormalParameter(builder, node, parent);
4143
} else if (node is Expression &&
4244
parent is AssignmentExpression &&
4345
parent.rightHandSide == node) {
@@ -164,6 +166,31 @@ class MakeVariableNullable extends CorrectionProducer {
164166
});
165167
}
166168

169+
/// Makes [parameter] nullable if possible.
170+
Future<void> _forSuperFormalParameter(ChangeBuilder builder,
171+
SimpleIdentifier name, SuperFormalParameter parameter) async {
172+
if (parameter.parameters != null) {
173+
// A function-typed field formal parameter.
174+
if (parameter.question != null) {
175+
return;
176+
}
177+
_variableName = parameter.identifier.name;
178+
await builder.addDartFileEdit(file, (builder) {
179+
// Add '?' after `)`.
180+
builder.addSimpleInsertion(parameter.endToken.end, '?');
181+
});
182+
} else {
183+
var type = parameter.type;
184+
if (type == null || !_typeCanBeMadeNullable(type)) {
185+
return;
186+
}
187+
_variableName = parameter.identifier.name;
188+
await builder.addDartFileEdit(file, (builder) {
189+
builder.addSimpleInsertion(type.end, '?');
190+
});
191+
}
192+
}
193+
167194
Future<void> _forVariableDeclaration(ChangeBuilder builder, Expression node,
168195
VariableDeclaration parent) async {
169196
var declarationList = parent.parent;

pkg/analysis_server/lib/src/services/correction/error_fix_status.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ CompileTimeErrorCode.SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY: needs evaluation
369369
CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER: needs evaluation
370370
CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED: needs fix; new in 2.17
371371
CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED: needs evaluation; new in 2.17
372-
CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL: needs fix; new in 2.17
372+
CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL: needs fix; https://github.com/dart-lang/sdk/issues/48359
373373
CompileTimeErrorCode.SUPER_IN_EXTENSION: needs evaluation
374374
CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT: needs evaluation
375375
CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR: needs evaluation

pkg/analysis_server/lib/src/services/search/search_engine.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ class MatchKind {
2323
/// A reference to an element in which it is being invoked.
2424
static const MatchKind INVOCATION = MatchKind('INVOCATION');
2525

26+
/// An invocation of an enum constructor from an enum constant without
27+
/// arguments.
28+
static const MatchKind INVOCATION_BY_ENUM_CONSTANT_WITHOUT_ARGUMENTS =
29+
MatchKind('INVOCATION_BY_ENUM_CONSTANT_WITHOUT_ARGUMENTS');
30+
2631
/// A reference to an element in which it is referenced.
2732
static const MatchKind REFERENCE = MatchKind('REFERENCE');
2833

pkg/analysis_server/lib/src/services/search/search_engine_internal.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ class SearchMatchImpl implements SearchMatch {
242242
if (kind == SearchResultKind.INVOCATION) {
243243
return MatchKind.INVOCATION;
244244
}
245+
if (kind ==
246+
SearchResultKind.INVOCATION_BY_ENUM_CONSTANT_WITHOUT_ARGUMENTS) {
247+
return MatchKind.INVOCATION_BY_ENUM_CONSTANT_WITHOUT_ARGUMENTS;
248+
}
245249
if (kind == SearchResultKind.REFERENCE_BY_CONSTRUCTOR_TEAR_OFF) {
246250
return MatchKind.REFERENCE_BY_CONSTRUCTOR_TEAR_OFF;
247251
}

0 commit comments

Comments
 (0)