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 gets applied to wrong invocation in selectDynamic expansion #6722

Closed
scabug opened this issue Nov 26, 2012 · 3 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Nov 26, 2012

import language.dynamics

class Dyn extends Dynamic {
  def selectDynamic(s: String): Dyn = new Dyn
  def get[T]: T = null.asInstanceOf[T]
}

object Foo {
  val dyn = new Dyn
  dyn.foo.bar.baz.get[String]
}
dynamic.scala:10: error: method selectDynamic: (s: String)Dyn does not take type parameters
error after rewriting to Foo.this.dyn.selectDynamic[String]("foo")
possible cause: maybe a wrong Dynamic method signature?
  dyn.foo.bar.baz.get[String]
  ^
one error found

It looks like the fix to #6320 (incidentally not marked as resolved yet, but the fix is in 2.10-RC2) applies the type parameter to the selectDynamic method, instead of the get method.

@scabug
Copy link
Author

scabug commented Nov 26, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6722?orig=1
Reporter: @propensive
Affected Versions: 2.10.0-RC2
Attachments:

  • dynamic.scala (created on Nov 26, 2012 5:56:39 PM UTC, 207 bytes)

@scabug
Copy link
Author

scabug commented Nov 28, 2012

@paulp said:
scala/scala#1681

@scabug
Copy link
Author

scabug commented Dec 5, 2012

@retronym said:
scala/scala@edbcc64

@scabug scabug closed this as completed Dec 5, 2012
@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017
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