Skip to content

Commit 70a6323

Browse files
Merge pull request #7542 from dotty-staging/fix-#6779
Fix #6779: Add regression test
2 parents 0e3c9e5 + 2a7257a commit 70a6323

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

tests/neg/i6779.check

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- [E007] Type Mismatch Error: tests/neg/i6779.scala:9:30 --------------------------------------------------------------
2+
9 |def g1[T](x: T): F[G[T]] = x.f(given summon[Stuff]) // error
3+
| ^^^^^^^^^^^^^^^^^^^^^^^^
4+
| Found: F[T]
5+
| Required: F[G[T]]
6+
-- [E007] Type Mismatch Error: tests/neg/i6779.scala:11:27 -------------------------------------------------------------
7+
11 |def g2[T](x: T): F[G[T]] = x.f // error
8+
| ^
9+
| Found: F[T]
10+
| Required: F[G[T]]
11+
-- [E007] Type Mismatch Error: tests/neg/i6779.scala:13:31 -------------------------------------------------------------
12+
13 |def g3[T](x: T): F[G[T]] = f(x)(given summon[Stuff]) // error
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
14+
| Found: F[T]
15+
| Required: F[G[T]]

tests/neg/i6779.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
type F[T]
2+
type G[T]
3+
type Stuff
4+
given Stuff = ???
5+
6+
def (x: T) f[T](given Stuff): F[T] = ???
7+
8+
9+
def g1[T](x: T): F[G[T]] = x.f(given summon[Stuff]) // error
10+
11+
def g2[T](x: T): F[G[T]] = x.f // error
12+
13+
def g3[T](x: T): F[G[T]] = f(x)(given summon[Stuff]) // error

0 commit comments

Comments
 (0)