Skip to content

Commit 741f568

Browse files
pqCommit Queue
authored andcommitted
[element model] migrate return_type_verifier
Change-Id: I8cdfd528bee381a2288ff739aec36f1b63bbfe61 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395085 Auto-Submit: Phil Quitslund <[email protected]> Commit-Queue: Phil Quitslund <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 1747e2d commit 741f568

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pkg/analyzer/analyzer_use_new_elements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ lib/src/error/nullable_dereference_verifier.dart
119119
lib/src/error/override_verifier.dart
120120
lib/src/error/redeclare_verifier.dart
121121
lib/src/error/required_parameters_verifier.dart
122-
lib/src/error/return_type_verifier.dart
123122
lib/src/error/super_formal_parameters_verifier.dart
124123
lib/src/error/type_arguments_verifier.dart
125124
lib/src/error/unused_local_elements_verifier.dart

pkg/analyzer/lib/src/error/return_type_verifier.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'package:analyzer/dart/ast/ast.dart';
6-
import 'package:analyzer/dart/element/element.dart';
6+
import 'package:analyzer/dart/element/element2.dart';
77
import 'package:analyzer/dart/element/nullability_suffix.dart';
88
import 'package:analyzer/dart/element/type.dart';
99
import 'package:analyzer/error/listener.dart';
@@ -83,7 +83,7 @@ class ReturnTypeVerifier {
8383
}
8484

8585
void checkElement(
86-
ClassElement expectedElement,
86+
ClassElement2 expectedElement,
8787
AnalyzerErrorCode errorCode,
8888
) {
8989
void reportError() {
@@ -112,18 +112,18 @@ class ReturnTypeVerifier {
112112
if (enclosingExecutable.isAsynchronous) {
113113
if (enclosingExecutable.isGenerator) {
114114
checkElement(
115-
_typeProvider.streamElement,
115+
_typeProvider.streamElement2,
116116
CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE,
117117
);
118118
} else {
119119
checkElement(
120-
_typeProvider.futureElement,
120+
_typeProvider.futureElement2,
121121
CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE,
122122
);
123123
}
124124
} else if (enclosingExecutable.isGenerator) {
125125
checkElement(
126-
_typeProvider.iterableElement,
126+
_typeProvider.iterableElement2,
127127
CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE,
128128
);
129129
}
@@ -294,7 +294,7 @@ class ReturnTypeVerifier {
294294
);
295295
}
296296

297-
bool _isLegalReturnType(ClassElement expectedElement) {
297+
bool _isLegalReturnType(ClassElement2 expectedElement) {
298298
DartType returnType = enclosingExecutable.returnType;
299299
//
300300
// When checking an async/sync*/async* method, we know the exact type

0 commit comments

Comments
 (0)