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

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

Issue 2988113002: Add Class.isEnum to Kernel and use it to resynthesize enums in Analyzer. (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
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 d018091f77bad8ae246ecfbe77b349acd2738f43..78aebc6d0fe4aa3cb8d69a7e17c5cf11c38e340c 100644
--- a/pkg/analyzer/lib/src/kernel/resynthesize.dart
+++ b/pkg/analyzer/lib/src/kernel/resynthesize.dart
@@ -637,7 +637,7 @@ class _KernelLibraryResynthesizerContextImpl
}
// Search in the class.
- if (parentElement is ClassElementImpl) {
+ if (parentElement is AbstractClassElementImpl) {
if (isGetter) {
return parentElement.getGetter(name.name) as ElementImpl;
} else if (isSetter) {
@@ -662,7 +662,8 @@ class _KernelLibraryResynthesizerContextImpl
kernel.CanonicalName className, List<kernel.DartType> kernelArguments) {
var libraryName = className.parent;
var libraryElement = _resynthesizer.getLibrary(libraryName.name);
- ClassElementImpl classElement = libraryElement.getType(className.name);
+ ClassElement classElement = libraryElement.getType(className.name);
+ classElement ??= libraryElement.getEnum(className.name);
if (kernelArguments.isEmpty) {
return classElement.type;
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698