forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make def generated from givens not synthetic
Fixes scala#12949
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
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
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,19 @@ | ||
object Catch22: | ||
trait TC[V] | ||
object TC: | ||
export Hodor.TC.given | ||
|
||
object Hodor: | ||
object TC: | ||
import Catch22.TC | ||
given fromString[V <: String]: TC[V] = ??? | ||
transparent inline given fromDouble[V <: Double]: TC[V] = | ||
new TC[V]: | ||
type Out = Double | ||
given fromInt[V <: Int]: TC[V] with | ||
type Out = Int | ||
|
||
object Test: | ||
summon[Catch22.TC["hi"]] //works | ||
summon[Catch22.TC[7.7]] //works | ||
summon[Catch22.TC[1]] //error |