Skip to content

Commit b3ab7e2

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Migrate lib/src/generated/ffi_verifier.dart
Change-Id: Ideefeacddd4b537777376b504e543c1c7f93c6f1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401263 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 6e5fb8b commit b3ab7e2

File tree

4 files changed

+243
-226
lines changed

4 files changed

+243
-226
lines changed

pkg/analyzer/analyzer_use_new_elements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ lib/src/generated/element_resolver.dart
107107
lib/src/generated/element_walker.dart
108108
lib/src/generated/error_verifier.dart
109109
lib/src/generated/exhaustiveness.dart
110-
lib/src/generated/ffi_verifier.dart
111110
lib/src/generated/inference_log.dart
112111
lib/src/generated/resolver.dart
113112
lib/src/generated/testing/element_factory.dart

pkg/analyzer/lib/src/dart/ast/ast.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12438,10 +12438,7 @@ final class NamedExpressionImpl extends ExpressionImpl
1243812438
@experimental
1243912439
@override
1244012440
FormalParameterElement? get element2 {
12441-
if (element case FormalParameterFragment fragment) {
12442-
return fragment.element;
12443-
}
12444-
return null;
12441+
return element?.asElement2;
1244512442
}
1244612443

1244712444
@override

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,22 @@ class FunctionTypeImpl extends TypeImpl implements FunctionType {
166166
alias: alias);
167167
}
168168

169+
factory FunctionTypeImpl.v2({
170+
required List<TypeParameterElement2> typeParameters,
171+
required List<FormalParameterElement> formalParameters,
172+
required DartType returnType,
173+
required NullabilitySuffix nullabilitySuffix,
174+
InstantiatedTypeAliasElement? alias,
175+
}) {
176+
return FunctionTypeImpl(
177+
typeFormals: typeParameters.map((e) => e.asElement).toList(),
178+
parameters: formalParameters.map((e) => e.asElement).toList(),
179+
returnType: returnType,
180+
nullabilitySuffix: nullabilitySuffix,
181+
alias: alias,
182+
);
183+
}
184+
169185
FunctionTypeImpl._({
170186
required this.typeFormals,
171187
required this.parameters,

0 commit comments

Comments
 (0)