Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport "Add tests to verify that crash is fixed elsewhere. Fixes #19328" to LTS #20875

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/neg/i19328.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- [E172] Type Error: tests/neg/i19328.scala:14:5 ----------------------------------------------------------------------
14 | bar // error: missing implicit (should not crash)
| ^
| No given instance of type Boolean was found for parameter bool of method bar in object i19328
14 changes: 14 additions & 0 deletions tests/neg/i19328.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import scala.language.implicitConversions

object i19328:

trait Foo[B]
given foo[C]: Foo[C] = new Foo[C] {}

type Id[A] = A

implicit def wrapId[A](a: A): Id[A] = a

def bar(using bool: Boolean): Unit = ()

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

trait Foo[B]
given foo[C]: Foo[C] = new Foo[C] {}

type Id[A] = A

given wrapId[A]: Conversion[A, Id[A]] with
def apply(x: A): Id[A] = x

def bar(using bool: Boolean): Unit = ()

bar // error: missing implicit (should not crash)