Skip to content

Type argument error shows _ #13934

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

Open
Adam-Vandervorst opened this issue Nov 12, 2021 · 1 comment
Open

Type argument error shows _ #13934

Adam-Vandervorst opened this issue Nov 12, 2021 · 1 comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug

Comments

@Adam-Vandervorst
Copy link

Compiler version

3.1.2-RC1-bin-20211025-968dd1b-NIGHTLY

Minimized code

type ToInt[X] = Int

@main def example =
  val xs = (???, ???)

  xs.map[ToInt]([C] => (x1: C) => x1 match {
    case x2: ([V] => () => Int) =>
      x2[Int]()
    case _ => 42
  })

Output

     x2[Int]()
         ^
        Type argument Int does not conform to upper bound _

Expectation

When trying to find a workaround to #13918, I stumbled across this weird error.
It seems like the _ should not be there, and if it should, I don't find the documentation on it.

@KacperFKorban KacperFKorban added the area:reporting Error reporting including formatting, implicit suggestions, etc label Nov 12, 2021
@ckipp01
Copy link
Member

ckipp01 commented May 15, 2023

Note that the error here is different now as of 3.3.1-RC1-bin-20230514-b0ccf40-NIGHTLY.

[warn] ./example.scala:12:16
[warn] the type test for [V] => () => Int cannot be checked at runtime because it's a refinement type
[warn]           case x2: ([V] => () => Int) =>
[warn]                ^
Compiled project (Scala 3.3.1-RC1-bin-20230514-b0ccf40-NIGHTLY, JVM)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug
Projects
None yet
Development

No branches or pull requests

3 participants