Skip to content

Commit 8b84cab

Browse files
raquoWojciechMazur
authored andcommitted
Add tests to verify that crash is fixed elsewhere. Fixes #19328
[Cherry-picked 8d7eda4]
1 parent 308da81 commit 8b84cab

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

Diff for: tests/neg/i19328.check

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- [E172] Type Error: tests/neg/i19328.scala:14:5 ----------------------------------------------------------------------
2+
14 | bar // error: missing implicit (should not crash)
3+
| ^
4+
| No given instance of type Boolean was found for parameter bool of method bar in object i19328

Diff for: tests/neg/i19328.scala

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import scala.language.implicitConversions
2+
3+
object i19328:
4+
5+
trait Foo[B]
6+
given foo[C]: Foo[C] = new Foo[C] {}
7+
8+
type Id[A] = A
9+
10+
implicit def wrapId[A](a: A): Id[A] = a
11+
12+
def bar(using bool: Boolean): Unit = ()
13+
14+
bar // error: missing implicit (should not crash)

Diff for: tests/neg/i19328conversion.check

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- [E172] Type Error: tests/neg/i19328conversion.scala:13:5 ------------------------------------------------------------
2+
13 | bar // error: missing implicit (should not crash)
3+
| ^
4+
| No given instance of type Boolean was found for parameter bool of method bar in object i19328conversion

Diff for: tests/neg/i19328conversion.scala

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
object i19328conversion:
2+
3+
trait Foo[B]
4+
given foo[C]: Foo[C] = new Foo[C] {}
5+
6+
type Id[A] = A
7+
8+
given wrapId[A]: Conversion[A, Id[A]] with
9+
def apply(x: A): Id[A] = x
10+
11+
def bar(using bool: Boolean): Unit = ()
12+
13+
bar // error: missing implicit (should not crash)

0 commit comments

Comments
 (0)