Skip to content

Commit ec0a310

Browse files
authored
Add regression test for #22320 (#22321)
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
2 parents 15ea35b + 2ae14c2 commit ec0a310

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

Diff for: tests/neg/i22320.check

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- [E008] Not Found Error: tests/neg/i22320.scala:19:19 ----------------------------------------------------------------
2+
19 | val z = system.z // error
3+
| ^^^^^^^^
4+
| value z is not a member of a.System.
5+
| An extension method was tried, but could not be fully constructed:
6+
|
7+
| a.z(system)
8+
|
9+
| failed with:
10+
|
11+
| Found: (system : a.System)
12+
| Required: a.SimulatedSystem

Diff for: tests/neg/i22320.scala

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package a:
2+
opaque type System = Any
3+
opaque type SimulatedSystem <: System = System
4+
5+
extension (system: System)
6+
def x: BigInt = ???
7+
def y: BigInt = ???
8+
end extension
9+
10+
extension (system: SimulatedSystem)
11+
def z: BigInt = ???
12+
end extension
13+
14+
package b:
15+
import a.*
16+
def issue(system: System) =
17+
val x = system.x
18+
val y = system.y
19+
val z = system.z // error

0 commit comments

Comments
 (0)