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

Unified Diff: pkg/analyzer/lib/src/kernel/resynthesize.dart

Issue 2992143002: Resynthesize type literals from Kernel. (Closed)
Patch Set: Created 3 years, 5 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 | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/kernel/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/kernel/resynthesize.dart b/pkg/analyzer/lib/src/kernel/resynthesize.dart
index 95783ddaf55da4e4ec286df0d5f82ed0b9c2efb4..cda1c2f8f22eee54b0bf72c75f89ba64f44d882f 100644
--- a/pkg/analyzer/lib/src/kernel/resynthesize.dart
+++ b/pkg/analyzer/lib/src/kernel/resynthesize.dart
@@ -33,6 +33,11 @@ class KernelResynthesizer {
KernelResynthesizer(this._analysisContext, this._types, this._kernelMap);
/**
+ * Return the `Type` type.
+ */
+ DartType get typeType => getLibrary('dart:core').getType('Type').type;
+
+ /**
* Return the [LibraryElementImpl] for the given [uriStr], or `null` if
* the library is not part of the Kernel libraries bundle.
*/
@@ -204,6 +209,14 @@ class _ExprBuilder {
keyword, constructorName, arguments);
}
+ if (expr is kernel.TypeLiteral) {
+ var type = _context.getType(null, expr.type);
+ var identifier = AstTestFactory.identifier3(type.element.name);
+ identifier.staticElement = type.element;
+ identifier.staticType = _context._resynthesizer.typeType;
+ return identifier;
+ }
+
// TODO(scheglov): complete getExpression
throw new UnimplementedError('kernel: (${expr.runtimeType}) $expr');
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698