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#7219: export forwarder should use TypeAlias for parameterle…
…ss class
- Loading branch information
1 parent
1d5e95e
commit 300b427
Showing
3 changed files
with
35 additions
and
1 deletion.
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,24 @@ | ||
object Foo { | ||
enum MyEnum { | ||
case Red | ||
case Blue(msg: String) | ||
} | ||
export MyEnum._ | ||
} | ||
|
||
object Bar { | ||
type Blue = Foo.Blue | ||
|
||
// Related Issue -- my expectation is that | ||
// `export Foo.Blue` should be equivalent to | ||
// `type Blue = Foo.Blue`, but it's not: | ||
|
||
// export Foo.Blue // Uncommenting this (and commenting `type Blue = ...`) results in compile error | ||
} | ||
|
||
import Foo._ | ||
|
||
def foo(a: MyEnum): Seq[Bar.Blue] = a match { | ||
case Red => Seq.empty | ||
case m: Foo.Blue => Seq(m) | ||
} |
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,9 @@ | ||
class Foo { | ||
object MyEnum { | ||
class Blue | ||
} | ||
export MyEnum._ | ||
|
||
val a: MyEnum.Blue = ??? | ||
a : Blue // ok | ||
} |