Skip to content

java generic signature for Array intersection does not match erasedGlb #12204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bishabosha opened this issue Apr 23, 2021 · 0 comments · Fixed by #12205
Closed

java generic signature for Array intersection does not match erasedGlb #12204

bishabosha opened this issue Apr 23, 2021 · 0 comments · Fixed by #12205

Comments

@bishabosha
Copy link
Member

bishabosha commented Apr 23, 2021

Compiler version

3.0.0-RC2

Minimized code

package dottyErasure

class Z {
  def intARRAY_131(x: Array[String] with Array[Int]): Unit = {}
}

Output

// javap -v dottyErasure.Z
public void intARRAY_131(java.lang.String[]);
    descriptor: ([I)V
    flags: ACC_PUBLIC
    Code:
      stack=0, locals=2, args_size=2
         0: return
      LineNumberTable:
        line 257: 0
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0       1     0  this   LdottyErasure/Z;
            0       1     1     x   [I
    Signature: #187                         // ([Ljava/lang/String;)V
    MethodParameters:
      Name                           Flags
      x                              final

Expectation

public void intARRAY_131(int[]);

@bishabosha bishabosha changed the title java generic signature for array intersection does not match erasedGlb java generic signature for Array intersection does not match erasedGlb Apr 23, 2021
smarter added a commit to dotty-staging/dotty that referenced this issue Apr 23, 2021
We can't just check the class symbol since both `Array[Int]` and
`Array[String]` have the same symbol but different erasure.

Fixes scala#12204.
smarter added a commit to dotty-staging/dotty that referenced this issue Apr 23, 2021
We can't just check the class symbol since both `Array[Int]` and
`Array[String]` have the same symbol but different erasure.

Fixes scala#12204.
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants