-
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.
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- [E172] Type Error: tests/neg/i8827.scala:22:26 ---------------------------------------------------------------------- | ||
22 | summon[Order[List[Foo]]] // error | ||
| ^ | ||
| No given instance of type pkg.Order[List[pkg.Foo]] was found for parameter x of method summon in object Predef. | ||
| I found: | ||
| | ||
| pkg.Order.orderList[pkg.Foo](/* missing */summon[pkg.Order[pkg.Foo]]) | ||
| | ||
| But no implicit values were found that match type pkg.Order[pkg.Foo]. | ||
| | ||
| One of the following imports might fix the problem: | ||
| | ||
| import pkg.Implicits.orderFoo | ||
| import pkg.Givens.orderFoo | ||
-- [E172] Type Error: tests/neg/i8827.scala:23:28 ---------------------------------------------------------------------- | ||
23 | summon[Order[Option[Foo]]] // error | ||
| ^ | ||
|No given instance of type pkg.Order[Option[pkg.Foo]] was found for parameter x of method summon in object Predef. | ||
|I found: | ||
| | ||
| pkg.Order.given_Order_Option[pkg.Foo](/* missing */summon[pkg.Order[pkg.Foo]]) | ||
| | ||
|But no implicit values were found that match type pkg.Order[pkg.Foo]. | ||
| | ||
|One of the following imports might fix the problem: | ||
| | ||
| import pkg.Implicits.orderFoo | ||
| import pkg.Givens.orderFoo |
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,23 @@ | ||
package pkg | ||
|
||
trait Order[A] | ||
|
||
object Order { | ||
implicit def orderList[A](implicit orderA: Order[A]): Order[List[A]] = ??? | ||
|
||
given [A](using orderA: Order[A]): Order[Option[A]] = ??? | ||
} | ||
|
||
class Foo | ||
|
||
object Implicits { | ||
implicit def orderFoo: Order[Foo] = ??? | ||
} | ||
|
||
object Givens { | ||
given orderFoo: Order[Foo] = ??? | ||
} | ||
|
||
@main def main: Unit = | ||
summon[Order[List[Foo]]] // error | ||
summon[Order[Option[Foo]]] // error |