Skip to content

Commit a7373ac

Browse files
committed
Fix java enum flag
Previously the flag is not set properly
1 parent af37d64 commit a7373ac

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

compiler/src/dotty/tools/dotc/core/classfile/ClassfileConstants.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ object ClassfileConstants {
362362
res = addFlag(res, nflags & JAVA_ACC_FINAL)
363363
res = addFlag(res, nflags & JAVA_ACC_SYNTHETIC)
364364
res = addFlag(res, nflags & JAVA_ACC_STATIC)
365+
res = addFlag(res, nflags & JAVA_ACC_ENUM)
365366
res = addFlag(res, nflags & JAVA_ACC_ABSTRACT)
366367
res = addFlag(res, nflags & JAVA_ACC_INTERFACE)
367368
res

compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ object TypeTestsCasts {
5959

6060
def replaceP(tp: Type)(implicit ctx: Context) = new TypeMap {
6161
def apply(tp: Type) = tp match {
62-
case tref: TypeRef
63-
if isPatternTypeSymbol(tref.typeSymbol) => WildcardType
64-
case AnnotatedType(_, annot)
65-
if annot.symbol == defn.UncheckedAnnot => WildcardType
62+
case tref: TypeRef if tref.typeSymbol.isPatternBound =>
63+
WildcardType(tref.underlying.bounds)
64+
case AnnotatedType(_, annot) if annot.symbol == defn.UncheckedAnnot =>
65+
WildcardType
6666
case _ => mapOver(tp)
6767
}
6868
}.apply(tp)
@@ -120,6 +120,9 @@ object TypeTestsCasts {
120120
maximizeType(P1, span, fromScala2x = false)
121121

122122
val res = P1 <:< P
123+
124+
debug.println(TypeComparer.explained(P1 <:< P))
125+
123126
debug.println("P1 : " + P1.show)
124127
debug.println("P1 <:< P = " + res)
125128

0 commit comments

Comments
 (0)