-
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.
Browse files
Browse the repository at this point in the history
This issue was found when running scala 3.6.2 code (latest stable version for now), but it seems that a fix was submitted in #21527 (which will be available in 3.6.3) Closes #22320
- Loading branch information
Showing
2 changed files
with
31 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,12 @@ | ||
-- [E008] Not Found Error: tests/neg/i22320.scala:19:19 ---------------------------------------------------------------- | ||
19 | val z = system.z // error | ||
| ^^^^^^^^ | ||
| value z is not a member of a.System. | ||
| An extension method was tried, but could not be fully constructed: | ||
| | ||
| a.z(system) | ||
| | ||
| failed with: | ||
| | ||
| Found: (system : a.System) | ||
| Required: a.SimulatedSystem |
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 @@ | ||
package a: | ||
opaque type System = Any | ||
opaque type SimulatedSystem <: System = System | ||
|
||
extension (system: System) | ||
def x: BigInt = ??? | ||
def y: BigInt = ??? | ||
end extension | ||
|
||
extension (system: SimulatedSystem) | ||
def z: BigInt = ??? | ||
end extension | ||
|
||
package b: | ||
import a.* | ||
def issue(system: System) = | ||
val x = system.x | ||
val y = system.y | ||
val z = system.z // error |