3

Our code is killing the Scala compiler with this message:

[error] how can getCommonSuperclass() do its job if different class symbols
        get the same bytecode-level internal name: scala/Tuple2$mcJD$sp

To figure it out I'm trying to understand what Tuple2$mcJD$sp is supposed to be. Is it the class generated for (Long, Double)? Is this documented somewhere? Thanks!


Some clues I have found so far:

  • I think the type abbreviations match those documented in Class.getName.
  • The name is generated in SpecializeTypes.specializedName. According to the code, the format is m<abbreviated method specialization types>c<abbreviated class specialization types>$sp.

Maybe it's considered a compiler internal thing and not documented anywhere.

Daniel Darabos
  • 26,991
  • 10
  • 102
  • 114
  • is that an actual error from `scalac`? – Erik Kaplun Jun 26 '14 at 10:43
  • The right term for this is [*name mangling*](https://en.wikipedia.org/wiki/Name_mangling) – om-nom-nom Jun 26 '14 at 10:50
  • Yes, it's an actual error. The compiler dies with `AssertionError` Looks like the problem was that Kryo told me to register `Tuple2$mcJD$sp` and I did. I switched to registering `(Long, Double)` instead now, and it seems to avoid crashing `scalac`. I'll file a bug if I can create a minimal test case. – Daniel Darabos Jun 26 '14 at 10:55

0 Answers0