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

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

Issue 3006983002: Fix for using enums as InterfaceType(s) when resynthesize from Kernel. (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/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 0931edff0db979af808457f9e5b5aa9d26bb53e7..d3c23f7e9c5b4f8cbccdcf94d746c04de16760d3 100644
--- a/pkg/analyzer/lib/src/kernel/resynthesize.dart
+++ b/pkg/analyzer/lib/src/kernel/resynthesize.dart
@@ -745,10 +745,26 @@ class _KernelUnitResynthesizerContextImpl
@override
InterfaceType getInterfaceType(
ElementImpl context, kernel.Supertype kernelType) {
+ if (kernelType.classNode.isEnum) {
+ return null;
Brian Wilkerson 2017/08/31 19:54:15 Does this mean that we won't be able to resynthesi
scheglov 2017/08/31 19:55:23 We can resynthesize enums. We just should not allo
+ }
return _getInterfaceType(
context, kernelType.className.canonicalName, kernelType.typeArguments);
}
+ @override
+ List<InterfaceType> getInterfaceTypes(
+ ElementImpl context, List<kernel.Supertype> types) {
+ var interfaceTypes = <InterfaceType>[];
+ for (kernel.Supertype kernelType in types) {
+ InterfaceType interfaceType = getInterfaceType(context, kernelType);
+ if (interfaceType != null) {
+ interfaceTypes.add(interfaceType);
+ }
+ }
+ return interfaceTypes;
+ }
+
@override
ConstructorElementImpl getRedirectedConstructor(
kernel.Constructor kernelConstructor, kernel.Procedure kernelFactory) {
« 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