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

type parameter inside structural type generates invalid reflective call #1906

Closed
scabug opened this issue Apr 20, 2009 · 2 comments
Closed
Assignees

Comments

@scabug
Copy link

scabug commented Apr 20, 2009

object o1 {
  implicit def f1[T](x: T) = new { def bar[U](x: U) = x }
  val q = "abc".bar("def")
}

object o2 {
  implicit def f1[T](x: T) = new { def bar(x: String) = x }
  val q = "abc".bar("def")
}

object o3 {
  implicit def f1[T](x: T) = new { def bar(x: T) = x }
  val q = "abc".bar("def")
}
scala> o1.q
res0: java.lang.String = def

scala> o2.q
res1: String = def

scala> o3.q
java.lang.NoSuchMethodException: o3$$$$anon$$3.bar(java.lang.String)
	at java.lang.Class.getMethod(Class.java:1581)
	at o3$$.reflMethod$$Method3(a.scala:13)
	at o3$$.<init>(a.scala:13)
	at o3$$.<clinit>(a.scala)
	at .<init>(<console>:5)
	at .<clinit>(<console>)
	at RequestResult$$.<init>(<console>:4)
	at RequestResult$$.<clinit>(<console>)
	at RequestResult$$result(<console>)
	at sun.reflect.Na...

Same behavior with -Ystruct-dispatch:no-cache for what it's worth.

@scabug
Copy link
Author

scabug commented Apr 20, 2009

Imported From: https://issues.scala-lang.org/browse/SI-1906?orig=1
Reporter: @paulp

@scabug
Copy link
Author

scabug commented Nov 8, 2009

@dubochet said:
Fixed in r19442.

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

No branches or pull requests

2 participants