newTypeName(foo$colon$colon)

71 views
Skip to first unread message

Eugene Burmako

unread,
Aug 3, 2012, 10:16:39 AM8/3/12
to scala-internals
Does this stand for "foo::" or for "foo.colon.colon"?

Paul Phillips

unread,
Aug 3, 2012, 10:35:40 AM8/3/12
to scala-i...@googlegroups.com
On Fri, Aug 3, 2012 at 7:16 AM, Eugene Burmako <eugene....@epfl.ch> wrote:
Does this stand for "foo::" or for "foo.colon.colon"?

There's no way to know (except that foo:: isn't a valid identifier.)

"Name mangling has outstripped the abilities of lonesome '$$'"
(Which of course means lonesome '$', thanks jira.)

class foo_:: {
  println("foo_::")
}

object foo_ {
  object colon {
    class colon { println("foo_.colon.colon") }
  }
}

// crash
how can getCommonSuperclass() do its job if different class symbols get the same bytecode-level internal name: foo_$colon$colon
at scala.Predef$.assert(Predef.scala:170)
at scala.tools.nsc.Global.assert(Global.scala:234)
at scala.tools.nsc.backend.jvm.GenASM$JBuilder.javaName(GenASM.scala:600)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1375)
at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:180) 
Reply all
Reply to author
Forward
0 new messages