changeset 60071:0ef08b8bd812 amber-demo-II

Automatic merge with sealed-types
author mcimadamore
date Fri, 14 Feb 2020 17:45:50 +0000
parents 2d039936dbb4 146827c3c8e9
children 9d08b2857f6f
files src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java	Thu Feb 13 23:10:50 2020 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java	Fri Feb 14 17:45:50 2020 +0000
@@ -948,8 +948,12 @@
             }
 
             for (Type sup : new ArrayList<>(supertypes)) {
-                java.util.List<Type> supers = superTypesInASealedHierarchy((ClassSymbol)sup.tsym, env, inSameCUOnly);
-                if ((supers == null || supers.isEmpty()) && !sup.tsym.isSealed()) {
+                if (sup.tsym instanceof ClassSymbol) {
+                    java.util.List<Type> supers = superTypesInASealedHierarchy((ClassSymbol)sup.tsym, env, inSameCUOnly);
+                    if ((supers == null || supers.isEmpty()) && !sup.tsym.isSealed()) {
+                        supertypes.remove(sup);
+                    }
+                } else {
                     supertypes.remove(sup);
                 }
             }