Skip to content

Commit 092728e

Browse files
pqCommit Queue
authored andcommitted
[CQ] [server] anticipate strict_top_level_inference
Related to https://dart-review.googlesource.com/c/sdk/+/412383 (Note: presubmit required some re-formatting 🤷) Change-Id: Ib18c7c1c1fceaa0007d804fbcb6397055242fa42 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412362 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Phil Quitslund <[email protected]> Auto-Submit: Phil Quitslund <[email protected]>
1 parent 024144e commit 092728e

File tree

8 files changed

+165
-157
lines changed

8 files changed

+165
-157
lines changed

pkg/analysis_server/benchmark/integration/operation.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ResponseOperation extends Operation {
8282
return converter.processExpectedResponse(id, completer);
8383
}
8484

85-
bool _equal(expectedResult, actualResult) {
85+
bool _equal(Object? expectedResult, Object? actualResult) {
8686
if (expectedResult is Map && actualResult is Map) {
8787
if (expectedResult.length == actualResult.length) {
8888
return expectedResult.keys.every((key) {
@@ -105,7 +105,7 @@ class ResponseOperation extends Operation {
105105
}
106106

107107
/// Compare the expected and actual server response result.
108-
void _processResult(actualResult) {
108+
void _processResult(Object? actualResult) {
109109
var expectedResult = responseJson['result'];
110110
if (!_equal(expectedResult, actualResult)) {
111111
var expectedError = responseJson['error'];

pkg/analysis_server/test/client/impl/expect_mixin.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ typedef _Predicate<T> = bool Function(T value);
88

99
/// Lightweight expect that can be run outside of a test context.
1010
mixin ExpectMixin {
11-
void expect(actual, matcher, {String? reason}) {
11+
void expect(Object? actual, Object? matcher, {String? reason}) {
1212
matcher = _wrapMatcher(matcher);
1313
var matchState = {};
1414
try {
@@ -21,7 +21,7 @@ mixin ExpectMixin {
2121
throw Exception(reason);
2222
}
2323

24-
static Matcher _wrapMatcher(x) {
24+
static Matcher _wrapMatcher(Object? x) {
2525
if (x is Matcher) {
2626
return x;
2727
} else if (x is _Predicate<Object>) {

pkg/analysis_server/test/integration/support/integration_tests.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void outOfTestExpect(
7070
}
7171

7272
String _defaultFailFormatter(
73-
actual,
73+
dynamic actual,
7474
Matcher matcher,
7575
String? reason,
7676
Map<Object?, Object?> matchState,
@@ -952,7 +952,7 @@ abstract class _RecursiveMatcher extends Matcher {
952952
/// the mismatch. [describeSubstructure] is used to describe which
953953
/// substructure did not match.
954954
void checkSubstructure(
955-
item,
955+
Object? item,
956956
Matcher matcher,
957957
List<MismatchDescriber> mismatches,
958958
Description Function(Description) describeSubstructure,
@@ -981,7 +981,7 @@ abstract class _RecursiveMatcher extends Matcher {
981981

982982
@override
983983
Description describeMismatch(
984-
item,
984+
Object? item,
985985
Description mismatchDescription,
986986
Map<Object?, Object?> matchState,
987987
bool verbose,
@@ -1026,7 +1026,7 @@ abstract class _RecursiveMatcher extends Matcher {
10261026

10271027
/// Populate [mismatches] with descriptions of all the ways in which [item]
10281028
/// does not match.
1029-
void populateMismatches(item, List<MismatchDescriber> mismatches);
1029+
void populateMismatches(Object? item, List<MismatchDescriber> mismatches);
10301030

10311031
/// Create a [MismatchDescriber] describing a mismatch with a simple string.
10321032
MismatchDescriber simpleDescription(String description) => (

pkg/analysis_server/test/lsp/code_lens/augmentations_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ void main() {
2020
});
2121
}
2222

23+
@reflectiveTest
2324
abstract class AbstractAugmentationCodeLensTest
2425
extends AbstractLspAnalysisServerTest {
2526
late TestCode libraryCode;

pkg/analysis_server/test/shared/shared_dtd_tests.dart

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
139139
await dtdProcess.dispose();
140140
}
141141

142-
test_connectToDtd_failure_alreadyRegistered() async {
142+
Future<void> test_connectToDtd_failure_alreadyRegistered() async {
143143
await initializeServer();
144144
await sendConnectToDtdRequest();
145145
await expectLater(
@@ -153,7 +153,7 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
153153
);
154154
}
155155

156-
test_connectToDtd_failure_invalidUri() async {
156+
Future<void> test_connectToDtd_failure_invalidUri() async {
157157
await initializeServer();
158158
await expectLater(
159159
sendConnectToDtdRequest(uri: invalidUri),
@@ -168,7 +168,7 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
168168
);
169169
}
170170

171-
test_connectToDtd_success_afterFailureToConnect() async {
171+
Future<void> test_connectToDtd_success_afterFailureToConnect() async {
172172
await initializeServer();
173173

174174
// Perform a failed connection.
@@ -188,7 +188,7 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
188188
await sendConnectToDtdRequest();
189189
}
190190

191-
test_connectToDtd_success_afterPreviousDtdShutdown() async {
191+
Future<void> test_connectToDtd_success_afterPreviousDtdShutdown() async {
192192
await initializeServer();
193193

194194
// Connect to the initial DTD.
@@ -205,20 +205,23 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
205205
await sendConnectToDtdRequest();
206206
}
207207

208+
Future<void>
208209
test_connectToDtd_success_doesNotRegister_connectToDtdMethod() async {
209210
await initializeServer();
210211
await sendConnectToDtdRequest();
211212

212213
expectMethod(CustomMethods.connectToDtd, available: false);
213214
}
214215

216+
Future<void>
215217
test_connectToDtd_success_doesNotRegister_experimentalMethods() async {
216218
await initializeServer();
217219
await sendConnectToDtdRequest();
218220

219221
expectMethod(CustomMethods.experimentalEcho, available: false);
220222
}
221223

224+
Future<void>
222225
test_connectToDtd_success_doesNotRegister_fileStateMethods() async {
223226
await initializeServer();
224227
await sendConnectToDtdRequest();
@@ -230,6 +233,7 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
230233
expectMethod(Method.textDocument_didChange, available: false);
231234
}
232235

236+
Future<void>
233237
test_connectToDtd_success_doesNotRegister_initializationMethods() async {
234238
await initializeServer();
235239
await sendConnectToDtdRequest();
@@ -239,15 +243,15 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
239243
expectMethod(Method.initialized, available: false);
240244
}
241245

242-
test_connectToDtd_success_registers_experimentalMethods() async {
246+
Future<void> test_connectToDtd_success_registers_experimentalMethods() async {
243247
await initializeServer();
244248
await sendConnectToDtdRequest(registerExperimentalHandlers: true);
245249

246250
expectMethod(CustomMethods.experimentalEcho);
247251
}
248252

249253
@SkippedTest(reason: 'Shared LSP methods are currently disabled')
250-
test_connectToDtd_success_registers_standardLspMethods() async {
254+
Future<void> test_connectToDtd_success_registers_standardLspMethods() async {
251255
await initializeServer();
252256
await sendConnectToDtdRequest();
253257

@@ -260,7 +264,7 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
260264
}
261265

262266
@SkippedTest(reason: 'Shared LSP methods are currently disabled')
263-
test_service_failure_hover() async {
267+
Future<void> test_service_failure_hover() async {
264268
await initializeServer();
265269
await sendConnectToDtdRequest();
266270

@@ -291,7 +295,7 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
291295
await expectLater(call, throwsA(expectedException));
292296
}
293297

294-
test_service_success_echo() async {
298+
Future<void> test_service_success_echo() async {
295299
await initializeServer();
296300
await sendConnectToDtdRequest(registerExperimentalHandlers: true);
297301

@@ -306,7 +310,7 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
306310
expect(result, equals({'a': 'b'}));
307311
}
308312

309-
test_service_success_echo_nullResponse() async {
313+
Future<void> test_service_success_echo_nullResponse() async {
310314
await initializeServer();
311315
await sendConnectToDtdRequest(registerExperimentalHandlers: true);
312316

@@ -322,7 +326,7 @@ mixin SharedDtdTests on LspRequestHelpersMixin {
322326
}
323327

324328
@SkippedTest(reason: 'Shared LSP methods are currently disabled')
325-
test_service_success_hover() async {
329+
Future<void> test_service_success_hover() async {
326330
var code = TestCode.parse('''
327331
/// A function.
328332
void [!myFun^ction!]() {}
@@ -361,7 +365,7 @@ void [!myFun^ction!]() {}
361365
}
362366

363367
@SkippedTest(reason: 'Shared LSP methods are currently disabled')
364-
test_service_unregisteredOnShutdown() async {
368+
Future<void> test_service_unregisteredOnShutdown() async {
365369
await initializeServer();
366370
await sendConnectToDtdRequest();
367371

0 commit comments

Comments
 (0)