File tree Expand file tree Collapse file tree 5 files changed +30
-4
lines changed
src/compiler/scala/tools/nsc/symtab/classfile Expand file tree Collapse file tree 5 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,6 @@ abstract class ClassfileParser {
4444
4545 def srcfile = srcfile0
4646
47- private def currentIsTopLevel = ! (currentClass.decodedName containsChar '$' )
48-
4947 private object unpickler extends scala.reflect.internal.pickling.UnPickler {
5048 val global : ClassfileParser .this .global.type = ClassfileParser .this .global
5149 }
@@ -515,8 +513,10 @@ abstract class ClassfileParser {
515513 }
516514 }
517515
518- val c = if (currentIsTopLevel) pool.getClassSymbol(nameIdx) else clazz
519- if (currentIsTopLevel) {
516+ val isTopLevel = ! (currentClass containsChar '$' ) // Java class name; *don't* try to to use Scala name decoding (SI-7532)
517+
518+ val c = if (isTopLevel) pool.getClassSymbol(nameIdx) else clazz
519+ if (isTopLevel) {
520520 if (c != clazz) {
521521 if ((clazz eq NoSymbol ) && (c ne NoSymbol )) clazz = c
522522 else mismatchError(c)
Original file line number Diff line number Diff line change 1+ class R {
2+ public class attr { // Will have the bytecode name `R$attr`, not to be confused with `R@tr`!
3+ }
4+ public static class attr1 {
5+ }
6+ }
Original file line number Diff line number Diff line change 1+ object Test {
2+ val r = new R
3+ new r.attr() // Was: error while loading attr, class file '.../t7532-pos.obj/R$attr.class' has location not matching its contents: contains class
4+ new R .attr1
5+ }
Original file line number Diff line number Diff line change 1+ package pack
2+ class R {
3+ class attr // Will have the bytecode name `R$attr`, not to be confused with `R@tr`!
4+ class `@`
5+ }
6+
7+ class `@`
Original file line number Diff line number Diff line change 1+ import pack ._
2+
3+ object Test {
4+ val r = new R
5+ new r.attr()
6+ new r.`@`
7+ new `@`
8+ }
You can’t perform that action at this time.
0 commit comments