Skip to content
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

generic signatures must account for value class erasure rules #6344

Closed
scabug opened this issue Sep 10, 2012 · 5 comments
Closed

generic signatures must account for value class erasure rules #6344

scabug opened this issue Sep 10, 2012 · 5 comments

Comments

@scabug
Copy link

scabug commented Sep 10, 2012

  scala> class Val[A](val value: Int) extends AnyVal
  defined class Val

  scala> class C2 { def foo[A](in: Val[A]) = in }
  defined class C2

  scala> classOf[C2].getMethods.head
  res4: java.lang.reflect.Method = public int C2.foo(int)

  scala> res4.getGenericParameterTypes
  res5: Array[java.lang.reflect.Type] = Array(.Val<A>)

That's bad, m'kay.

Discussion: https://groups.google.com/d/topic/scala-sips/KSm99KoiYNA/discussion

@scabug
Copy link
Author

scabug commented Sep 10, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6344?orig=1
Reporter: @retronym
Affected Versions: 2.10.0
Other Milestones: 2.10.0
See #3452, #6336

@scabug
Copy link
Author

scabug commented Sep 10, 2012

@harrah said:
Possibly related comment from Paolo in #3452: "classes extending AnyVal are erased correctly, but not in generic signatures"

https://issues.scala-lang.org/browse/SI-3452?focusedCommentId=57837&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-57837

@scabug
Copy link
Author

scabug commented Sep 18, 2012

@axel22 said:
Assigned to you Paul based upon the suggestion on the Scala meeting :)

@scabug
Copy link
Author

scabug commented Sep 19, 2012

@paulp said:
scala/scala#1345

@scabug
Copy link
Author

scabug commented Sep 28, 2012

@gkossakowski said:
Paul said (in scala/scala#1345):
bq. I'm not enormously confident that I'm generating the right signatures, but it's closer at worst.

I'm actually getting more confident so I'll mark this as fixed. Please reopen if you find issues with generic signatures and value classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants