forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to verify that crash is fixed elsewhere. Fixes scala#19328
- Loading branch information
Showing
6 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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 = () | ||
|
||
given Boolean = true | ||
|
||
bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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 = () | ||
|
||
given Boolean = true | ||
|
||
bar |