Skip to content

Commit d4a47aa

Browse files
authored
Merge pull request #6259 from dotty-staging/i6151
Fix #6151: MatchError for imported java enum Values
2 parents 99d27ed + df5efbe commit d4a47aa

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
254254
}
255255
case t: TypeApply if (t.fun.symbol == Predef_classOf) =>
256256
av.visit(name, t.args.head.tpe.classSymbol.denot.info.toTypeKind(bcodeStore)(innerClasesStore).toASMType)
257-
case t: tpd.Select =>
257+
case t: tpd.RefTree =>
258258
if (t.symbol.denot.owner.is(Flags.JavaEnum)) {
259259
val edesc = innerClasesStore.typeDescriptor(t.tpe.asInstanceOf[bcodeStore.int.Type]) // the class descriptor of the enumeration class.
260260
val evalue = t.symbol.name.mangledString // value the actual enumeration value.

tests/pos/i6151/Expect.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public enum Expect { ExpectVal }

tests/pos/i6151/Outcome.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public @interface Outcome { Expect enm(); }

tests/pos/i6151/Test.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Expect._
2+
@Outcome(ExpectVal)
3+
class SimpleTest

0 commit comments

Comments
 (0)