metals icon indicating copy to clipboard operation
metals copied to clipboard

Scala3: inferred type parameters shown twice

Open unthingable opened this issue 2 years ago • 3 comments

Describe the bug

image

Even though a parameter is explicitly specified, another [A] is shown.

A more complex example:

class SliderBankMode[Proxy, Param](
  override val id: String,
  val obj: Int => Proxy,
  val param: Proxy => Param,
  val barMode: Seq[BarMode],
  val stripColor: Option[Int => Int] = None,
)(using ext: MonsterJamExt, j: JamSurface, pValue: ParamValue[Param], exists: Exists[Proxy])
    extends SimpleModeLayer(id)

image

Vector type is displayed correctly, but new SliderBankMode has two sets of parameters.

Expected behavior

No response

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

0.11.18

Extra context or search terms

Scala 3.2.1-RC1

unthingable avatar Sep 12 '22 08:09 unthingable

@unthingable Thank you for reporting! Indeed it (after extends C1[A]) shouldn't be shown.

tanishiking avatar Sep 12 '22 09:09 tanishiking

https://github.com/lampepfl/dotty/pull/16031 this PR should fix the problem :)

tanishiking avatar Sep 13 '22 11:09 tanishiking

3.2.1-RC2 (or 3.2.1) should fix the issue, let's close after confirming this is fixed in the next release version.

tanishiking avatar Sep 14 '22 02:09 tanishiking

Looks like it might end up in 3.3.x, the recent nightlies seem to work ok.

tgodzik avatar Nov 30 '22 17:11 tgodzik