Skip to content

Commit c4b9060

Browse files
committed
Add neg test
1 parent 25d1975 commit c4b9060

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/neg/i7613.check

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- Error: tests/neg/i7613.scala:10:16 ----------------------------------------------------------------------------------
2+
10 | new BazLaws[A] {} // error // error
3+
| ^
4+
| no implicit argument of type Baz[A] was found for parameter x$1 of constructor BazLaws in trait BazLaws
5+
-- Error: tests/neg/i7613.scala:10:2 -----------------------------------------------------------------------------------
6+
10 | new BazLaws[A] {} // error // error
7+
| ^
8+
| no implicit argument of type Bar[A] was found for parameter x$1 of constructor BarLaws in trait BarLaws

tests/neg/i7613.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
trait Foo[A]
2+
trait Bar[A] extends Foo[A]
3+
trait Baz[A] extends Bar[A]
4+
5+
trait FooLaws[A](using Foo[A])
6+
trait BarLaws[A](using Bar[A]) extends FooLaws[A]
7+
trait BazLaws[A](using Baz[A]) extends BarLaws[A]
8+
9+
def instance[A](using Foo[A]): BazLaws[A] =
10+
new BazLaws[A] {} // error // error
11+

0 commit comments

Comments
 (0)