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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java

Issue 46663008: Issue 14524. Support for function type alias as a type literal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
index 14cbe315dd8bd105374a6529bb5e7094aabe0338..8a81a59b15caedea629bd6dff936051894479103 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
@@ -1054,7 +1054,11 @@ public class StaticTypeAnalyzer extends SimpleASTVisitor<Void> {
staticType = typeProvider.getTypeType();
}
} else if (staticElement instanceof FunctionTypeAliasElement) {
- staticType = ((FunctionTypeAliasElement) staticElement).getType();
+ if (isNotTypeLiteral(node)) {
+ staticType = ((FunctionTypeAliasElement) staticElement).getType();
+ } else {
+ staticType = typeProvider.getTypeType();
+ }
} else if (staticElement instanceof MethodElement) {
staticType = ((MethodElement) staticElement).getType();
} else if (staticElement instanceof PropertyAccessorElement) {
@@ -1269,7 +1273,11 @@ public class StaticTypeAnalyzer extends SimpleASTVisitor<Void> {
staticType = typeProvider.getTypeType();
}
} else if (element instanceof FunctionTypeAliasElement) {
- staticType = ((FunctionTypeAliasElement) element).getType();
+ if (isNotTypeLiteral(node)) {
+ staticType = ((FunctionTypeAliasElement) element).getType();
+ } else {
+ staticType = typeProvider.getTypeType();
+ }
} else if (element instanceof MethodElement) {
staticType = ((MethodElement) element).getType();
} else if (element instanceof PropertyAccessorElement) {
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698