Skip to content

Type parameter gets applied to wrong invocation in selectDynamic expansion #6722

@scabug

Description

@scabug
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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions