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

Unified Diff: pkg/analyzer/tool/summary/generate.dart

Issue 2622303006: Reapply "Add support for generic function type syntax, part 1" (Closed)
Patch Set: 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
« no previous file with comments | « pkg/analyzer/test/src/task/dart_test.dart ('k') | pkg/dev_compiler/lib/src/compiler/ast_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/tool/summary/generate.dart
diff --git a/pkg/analyzer/tool/summary/generate.dart b/pkg/analyzer/tool/summary/generate.dart
index d3fd86372118f1a537ee09e71d8f2b0e9be5a735..6db5cf034681b335e6aa06cd4c06e672cc21ddd3 100644
--- a/pkg/analyzer/tool/summary/generate.dart
+++ b/pkg/analyzer/tool/summary/generate.dart
@@ -268,10 +268,13 @@ class _CodeGenerator {
for (ClassMember classMember in decl.members) {
if (classMember is MethodDeclaration && classMember.isGetter) {
String desc = '$clsName.${classMember.name.name}';
- TypeName type = classMember.returnType;
- if (type == null) {
- throw new Exception('Class member needs a type: $desc');
+ if (classMember.returnType is! TypeName) {
+ if (classMember.returnType == null) {
+ throw new Exception('Class member needs a type: $desc');
+ }
+ throw new Exception('Class member needs a class type: $desc');
}
+ TypeName type = classMember.returnType;
bool isList = false;
if (type.name.name == 'List' &&
type.typeArguments != null &&
« no previous file with comments | « pkg/analyzer/test/src/task/dart_test.dart ('k') | pkg/dev_compiler/lib/src/compiler/ast_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698