File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed
compiler/src/dotty/tools/dotc/typer
pos-special/fatal-warnings Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -982,7 +982,8 @@ class Namer { typer: Typer =>
982
982
*/
983
983
def fwdInfo (ref : Type , info : Type ): Type = info match {
984
984
case _ : ClassInfo =>
985
- HKTypeLambda .fromParams(info.typeParams, ref)
985
+ if (info.typeParams.isEmpty) TypeAlias (ref)
986
+ else HKTypeLambda .fromParams(info.typeParams, ref)
986
987
case _ : TypeBounds =>
987
988
TypeAlias (ref)
988
989
case info : HKTypeLambda =>
Original file line number Diff line number Diff line change
1
+ object Foo {
2
+ enum MyEnum {
3
+ case Red
4
+ case Blue (msg : String )
5
+ }
6
+ export MyEnum ._
7
+ }
8
+
9
+ object Bar {
10
+ type Blue = Foo .Blue
11
+
12
+ // Related Issue -- my expectation is that
13
+ // `export Foo.Blue` should be equivalent to
14
+ // `type Blue = Foo.Blue`, but it's not:
15
+
16
+ // export Foo.Blue // Uncommenting this (and commenting `type Blue = ...`) results in compile error
17
+ }
18
+
19
+ import Foo ._
20
+
21
+ def foo (a : MyEnum ): Seq [Bar .Blue ] = a match {
22
+ case Red => Seq .empty
23
+ case m : Foo .Blue => Seq (m)
24
+ }
Original file line number Diff line number Diff line change
1
+ class Foo {
2
+ object MyEnum {
3
+ class Blue
4
+ }
5
+ export MyEnum ._
6
+
7
+ val a : MyEnum .Blue = ???
8
+ a : Blue // ok
9
+ }
You can’t perform that action at this time.
0 commit comments