Skip to content

selectDynamic swallows type parameters #6731

@scabug

Description

@scabug

Exhibit #1:

import language.dynamics

object Foo extends Dynamic {
  def selectDynamic(name: String) = ???
  println(this.bar[Int])
}
[[syntax trees at end of                     typer]] // Test.scala
package <empty> {
  import scala.language.dynamics;
  object Foo extends AnyRef with Dynamic {
    def <init>(): Foo.type = {
      Foo.super.<init>();
      ()
    };
    def selectDynamic(name: String): Nothing = scala.this.Predef.???;
    scala.this.Predef.println(this.selectDynamic("bar"))
  }
}

Exhibit #2:

import language.dynamics

object Foo extends Dynamic {
  def selectDynamic[T](name: String) = ???
  println(this.bar[Int])
}
[[syntax trees at end of                     typer]] // Test.scala
package <empty> {
  import scala.language.dynamics;
  object Foo extends AnyRef with Dynamic {
    def <init>(): Foo.type = {
      Foo.super.<init>();
      ()
    };
    def selectDynamic[T >: Nothing <: Any](name: String): Nothing = scala.this.Predef.???;
    scala.this.Predef.println(this.selectDynamic[Nothing]("bar"))
  }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions