Skip to content

no implicit values were found with curried type parameters #13541

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

Closed
armanbilge opened this issue Sep 16, 2021 · 0 comments · Fixed by #13650
Closed

no implicit values were found with curried type parameters #13541

armanbilge opened this issue Sep 16, 2021 · 0 comments · Fixed by #13650
Labels
area:implicits related to implicits itype:bug
Milestone

Comments

@armanbilge
Copy link
Contributor

armanbilge commented Sep 16, 2021

Compiler version

Scala compiler version 3.0.2 -- Copyright 2002-2021, LAMP/EPFL

Minimized code

trait F[A]
trait Z
object Z:
  given F[Z] = ???

type Foo[B] = [A] =>> Bar[A, B]
trait Bar[A, B]

given [A: F]: Foo[Unit][A] = ???
// given [A: F]: Bar[A, Unit] = ???

def f[A: F](using Foo[Unit][A]): Nothing = ???

def broken: Nothing = f[Z]

Output

-- Error: bug.scala:14:26 ------------------------------------------------------
14 |def broken: Nothing = f[Z]
   |                          ^
   |no implicit argument of type Foo[Unit][Z] was found for parameter x$1 of method f.
   |I found:
   |
   |    given_Foo_Unit_A[A](/* missing */summon[F[?]])
   |
   |But no implicit values were found that match type F[?].
1 error found

Expectation

Should compile, just like it does after de-aliasing:

-given [A: F]: Foo[Unit][A] = ???
-// given [A: F]: Bar[A, Unit] = ???
+// given [A: F]: Foo[Unit][A] = ???
+given [A: F]: Bar[A, Unit] = ???
@bishabosha bishabosha added the area:implicits related to implicits label Sep 16, 2021
odersky added a commit to dotty-staging/dotty that referenced this issue Oct 1, 2021
The test gave a false negative in the case where a parameter was
instantiated to the same value in both constraints. In that case
the parameter is not "contained" in either constraint, since it
is already instantiated, and that caused the test to fail.

Fixes scala#13541
olsdavis pushed a commit to olsdavis/dotty that referenced this issue Apr 4, 2022
The test gave a false negative in the case where a parameter was
instantiated to the same value in both constraints. In that case
the parameter is not "contained" in either constraint, since it
is already instantiated, and that caused the test to fail.

Fixes scala#13541
@Kordyjan Kordyjan added this to the 3.1.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:implicits related to implicits itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants