Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2151)

Unified Diff: pkg/analyzer/lib/src/generated/testing/element_factory.dart

Issue 2647833002: fix #28008, fix #28009 implement FutureOr<T> (Closed)
Patch Set: Merge remote-tracking branch 'origin/master' into 28008_futureort Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/testing/element_factory.dart
diff --git a/pkg/analyzer/lib/src/generated/testing/element_factory.dart b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
index 9069137e242ed62cc249b03ee2f8d01c8328ff38..d6ad24519bb1f24ac209447ecbd693d12308c88b 100644
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
@@ -230,12 +230,12 @@ class ElementFactory {
functionElement4(functionName, null, null, null, null);
static FunctionElementImpl functionElement2(
- String functionName, TypeDefiningElement returnElement) =>
- functionElement3(functionName, returnElement, null, null);
+ String functionName, DartType returnType) =>
+ functionElement3(functionName, returnType, null, null);
static FunctionElementImpl functionElement3(
String functionName,
- TypeDefiningElement returnElement,
+ DartType returnType,
List<TypeDefiningElement> normalParameters,
List<TypeDefiningElement> optionalParameters) {
// We don't create parameter elements because we don't have parameter names
@@ -243,12 +243,7 @@ class ElementFactory {
new FunctionElementImpl(functionName, 0);
FunctionTypeImpl functionType = new FunctionTypeImpl(functionElement);
functionElement.type = functionType;
- // return type
- if (returnElement == null) {
- functionElement.returnType = VoidTypeImpl.instance;
- } else {
- functionElement.returnType = returnElement.type;
- }
+ functionElement.returnType = returnType ?? VoidTypeImpl.instance;
// parameters
int normalCount = normalParameters == null ? 0 : normalParameters.length;
int optionalCount =
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698