-
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.
Merge pull request #7223 from dotty-staging/fix-7219
Fix #7219: export forwarder should use TypeAlias for parameterless class
- Loading branch information
Showing
4 changed files
with
83 additions
and
20 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,18 @@ | ||
object Foo { | ||
enum MyEnum { | ||
case Red | ||
case Blue(msg: String) | ||
} | ||
export MyEnum._ | ||
} | ||
|
||
object Bar { | ||
type Blue = Foo.Blue | ||
} | ||
|
||
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,18 @@ | ||
object Foo { | ||
enum MyEnum { | ||
case Red | ||
case Blue(msg: String) | ||
} | ||
export MyEnum._ | ||
} | ||
|
||
object Bar { | ||
export Foo.Blue | ||
} | ||
|
||
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,36 @@ | ||
class Foo { | ||
object MyEnum { | ||
class Blue | ||
} | ||
export MyEnum._ | ||
|
||
val a: MyEnum.Blue = ??? | ||
a : Blue // ok | ||
} | ||
|
||
object Test { | ||
object Types { | ||
type T <: AnyRef | ||
type U = T | ||
type TC[X] <: AnyRef | ||
type UC[X] = TC[(X, X)] | ||
class C | ||
class D[X] extends C | ||
def x1: T = ??? | ||
def x2: U = ??? | ||
def x3: TC[Int] = ??? | ||
def x4: UC[Int] = ??? | ||
def x5: C = C() | ||
def x6: D[Int] = D() | ||
} | ||
export Types._ | ||
type D1 = Types.D | ||
type U1 = Types.UC | ||
|
||
val y1: T = x1 | ||
val y2: U = x2 | ||
val y3: TC[Int] = x3 | ||
val y4: UC[Int] = x4 | ||
val y5: C = x5 | ||
val y6: D[Int] = x6 | ||
} |