-
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.
Detect case where two alternatives are the same after widening ExprTy…
…pes (#18787) In implicit or extension method search we might get two alternatives that are different but that point to the same singleton type after widening ExprTypes. In that case we can arbitrarily pick one of them instead of declaring an ambiguity. Fixes #18768
- Loading branch information
Showing
2 changed files
with
57 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package minimized: | ||
object Module: | ||
object Exportee: | ||
|
||
opaque type Id = Long | ||
|
||
def apply(): Id = ??? | ||
|
||
extension (e: Id) | ||
def updated: Id = ??? | ||
|
||
|
||
object Client: | ||
export Module.* | ||
val x = Exportee().updated | ||
|
||
package original: | ||
object Module: | ||
trait EntityDef: | ||
type Id | ||
type Record | ||
type Entity = (Id, Record) | ||
|
||
extension (e: Entity) | ||
def updated: Entity = e | ||
|
||
case class Exportee() | ||
object Exportee extends EntityDef: | ||
opaque type Id = Long | ||
type Record = Exportee | ||
|
||
def apply(id: Long): Entity = (id, Exportee()) | ||
|
||
object Client: | ||
export Module.* | ||
val x = Exportee(1L).updated | ||
|
||
|
||
object ClientWorkingWithManualExport: | ||
export Module.{Exportee as _, *} | ||
type Exportee = Module.Exportee | ||
val Exportee = Module.Exportee | ||
|
||
val x = Exportee(1L).updated |