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

Unified Diff: pkg/kernel/lib/ast.dart

Issue 2986393002: Record Typedef reference into Kernel FunctionType and resynthesyze typedefs in Analyzer. (Closed)
Patch Set: Created 3 years, 4 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/kernel/lib/ast.dart
diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart
index 76c28cd75e0b694f9ecb2ea5eabbd89c73951e01..d473259b87ad0b6807fa5f20142809b17b21bfec 100644
--- a/pkg/kernel/lib/ast.dart
+++ b/pkg/kernel/lib/ast.dart
@@ -4143,6 +4143,10 @@ class FunctionType extends DartType {
@informative
final List<String> positionalParameterNames;
+ /// The [Typedef] this function type is created for.
+ @informative
Paul Berry 2017/08/03 20:25:45 I think we should drop "@informative" here. I rea
scheglov 2017/08/03 21:00:32 Done.
+ Reference typedefReference;
+
final DartType returnType;
int _hashCode;
@@ -4150,11 +4154,16 @@ class FunctionType extends DartType {
{this.namedParameters: const <NamedType>[],
this.typeParameters: const <TypeParameter>[],
int requiredParameterCount,
- this.positionalParameterNames: const <String>[]})
+ this.positionalParameterNames: const <String>[],
+ this.typedefReference})
: this.positionalParameters = positionalParameters,
this.requiredParameterCount =
requiredParameterCount ?? positionalParameters.length;
+ /// The [Typedef] this function type is created for.
+ @informative
Paul Berry 2017/08/03 20:25:45 Also drop "@informative" here
scheglov 2017/08/03 21:00:32 Done.
+ Typedef get typedef => typedefReference?.asTypedef;
+
accept(DartTypeVisitor v) => v.visitFunctionType(this);
visitChildren(Visitor v) {
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_function_type_builder.dart ('k') | pkg/kernel/lib/binary/ast_from_binary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698