Skip to content

Type of the typed hole not inferred on invocation via applyDynamic #7538

Open
scala/scala3
#23420
@TomasMikula

Description

@TomasMikula

Describe the bug

object TypedHoleApplyDynamic {
  val obj: reflect.Selectable {
    def method(x: Int, y: String): Unit
  } = new reflect.Selectable {
    def method(x: Int, y: String): Unit = ()
  }

  obj.method(???, ???)
}

The expression type of the first argument is reported as Any, instead of Int:

Image

Expected behavior

Would be great if it would pick up the type declared in the type of obj.

Operating system

None

Editor/Extension

VS Code

Version of Metals

v1.5.3

Extra context or search terms

No response

Metadata

Metadata

Assignees

Labels

Scala 3Generic ticket relating to Scala 3bugSomething that is making a piece of functionality unusableupstream-fix-neededWaiting on a fix upstream

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions