-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add special handling for comparisons with Singleton types (#20474)
- Loading branch information
Showing
3 changed files
with
34 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
sealed trait Schema[A] | ||
|
||
object Schema extends RecordInstances: | ||
case class Field[A]() | ||
|
||
sealed trait RecordInstances: | ||
self: Schema.type => | ||
|
||
case class Record[A](field: Field[A]) extends Schema[A] | ||
|
||
import Schema._ | ||
|
||
val field: Field[Int] = Field() | ||
|
||
// Uh oh Found Playground.Schema.Field[Int] but Requried RecordInstances.this.Field[Int] | ||
val record = Record[Int](field) |