Skip to content

Commit

Permalink
Add failing test for #8827
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrf committed Jun 14, 2023
1 parent 89de881 commit 93510a9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/neg/i8827.check
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
23 changes: 23 additions & 0 deletions tests/neg/i8827.scala
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

0 comments on commit 93510a9

Please sign in to comment.