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; |