-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring back ambiguity filter when we report an implicit not found error
This reverts one part of #20261. When we fail with both an ambiguity on one implicit argument and another error on another argument we prefer the other error. I added a comment why this is needed. Fixes #20344 [Cherry-picked 863077c]
- Loading branch information
1 parent
7da5b79
commit d33a968
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
trait Monad[F[_]] extends Invariant[F] | ||
|
||
trait Invariant[F[_]] | ||
object Invariant: | ||
implicit def catsInstancesForList: Monad[List] = ??? | ||
implicit def catsInstancesForVector: Monad[Vector] = ??? | ||
|
||
trait Shrink[T] | ||
object Shrink extends ShrinkLowPriorityImplicits: | ||
trait Buildable[T,C] | ||
implicit def shrinkContainer[C[_],T](implicit v: C[T] => Traversable[T], s: Shrink[T], b: Buildable[T,C[T]]): Shrink[C[T]] = ??? | ||
trait ShrinkLowPriorityImplicits: | ||
implicit def shrinkAny[T]: Shrink[T] = ??? | ||
|
||
trait Distribution[F[_], -P, X] extends (P => F[X]) | ||
type GenBeta[A, B, X] = [F[_]] =>> Distribution[F, Beta.Params[A, B], X] | ||
type Beta[R] = [F[_]] =>> GenBeta[R, R, R][F] | ||
|
||
object Beta: | ||
trait Params[+A, +B] | ||
trait BetaInstances: | ||
given schrodingerRandomBetaForDouble[F[_]: Monad]: Beta[Double][F] = ??? | ||
|
||
object all extends BetaInstances | ||
|
||
@main def Test = | ||
import all.given | ||
summon[Shrink[Beta.Params[Double, Double]]] |