Skip to content

Incomplete implicit dictionaries should be rejected #6796

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
milessabin opened this issue Jul 3, 2019 · 0 comments · Fixed by #6798
Closed

Incomplete implicit dictionaries should be rejected #6796

milessabin opened this issue Jul 3, 2019 · 0 comments · Fixed by #6798
Assignees
Labels
area:implicits related to implicits itype:bug

Comments

@milessabin
Copy link
Contributor

This is Dotty's equivalent of scala/bug#11591. Here, rather than crashing the compiler, it compiles incorrectly yielding a null. The correct behaviour is to report an implicit search failure.

object Test {
  class A
  class B

  implicit def mkA(implicit b: => B): A = ???
  implicit def mkB(implicit a: A, i: Int): B = ???

  implicitly[A]
}

PR incoming ...

@milessabin milessabin added itype:bug area:implicits related to implicits labels Jul 3, 2019
@milessabin milessabin self-assigned this Jul 3, 2019
milessabin added a commit to milessabin/dotty that referenced this issue Jul 3, 2019
If any RHS of a recursive implicit dictionary (after pruning) is an
EmptyTree, then this indicates that implicit search failed and we should
report the overall search as a failure.

Fixes scala#6796
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.

1 participant