Skip to content

scalap unable to parse signatures with a constant type over a java enum #5194

@scabug

Description

@scabug

Just started to work on some scalap related issues and found following problem:
Example:

Java:

package com;

public enum K {
    K
}

Scala:

package com

object KK {
  val k = com.K.K
}

object ZZ {
  final val z = com.K.K
}

After compilation scalap can open class KK, however for class ZZ it's failed with exception.
Problem with value getter type. It has different byte code presentation:
28 7 -62 -128 -124 0 29 in first case
28 7 -62 -128 -124 2 29 in second case (this is failed for type parser => exception)
It's almost the same, however it should be exactly the same, because only difference is final modifier (I think second case shouldn't compile at all, because value z is already final, however it's not related issue).
I'm not sure if it's compiler related bug, so if you can explain me this difference, feel free to assign this issue to me, I'll fix it in scalap.

Original class with this problem (compiled with 2.8.1): play-scala.jar!\play\db\jpa\FetchTypeWrapper.class
I checked with 2.9.1, still the same.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions