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.
fix scala#12949: export synthetic given co-defined with class
Co-authored-by: Martin Odersky <odersky@gmail.com> Co-authored-by: Jamie Thompson <bishbashboshjt@gmail.com>
- Loading branch information
1 parent
8a6703f
commit 657ab61
Showing
5 changed files
with
54 additions
and
15 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
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
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 |