Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When creating an exported type alias of a class that has a constructor proxy companion, export an alias for that companion with it. The alias is again a constructor proxy. Fixes #12299
- Loading branch information
Showing
10 changed files
with
136 additions
and
15 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
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
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 Outer { | ||
|
||
object Inner { | ||
class Bar(x: Int) | ||
object Bar | ||
} | ||
|
||
export Inner.Bar._ | ||
|
||
val _ = apply(2) // error (constructor proxies are not exported) | ||
|
||
} | ||
object Outer2 { | ||
|
||
object Inner { | ||
class Bar(x: Int) | ||
object Bar | ||
} | ||
|
||
export Inner.Bar.apply // error: no eligible member | ||
|
||
val _ = apply(2) // error (constructor proxies are not exported) | ||
|
||
} |
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,54 @@ | ||
object Outer0 { | ||
|
||
object Inner { | ||
class Bar(x: Int): | ||
def this() = this(0) | ||
} | ||
|
||
export Inner.Bar | ||
|
||
val _ = Bar() | ||
val _ = Bar(2) | ||
|
||
} | ||
|
||
object Outer2 { | ||
|
||
object Inner { | ||
class Bar(x: Int): | ||
def this() = this(0) | ||
} | ||
|
||
object test2: | ||
export Inner._ | ||
|
||
val x = Bar() | ||
val y = Bar(2) | ||
|
||
object test3: | ||
export Inner.Bar | ||
def Bar: () => String = () => "" | ||
val x = Bar() | ||
} | ||
|
||
object Outer3 { | ||
export Outer0._ | ||
|
||
private val x = Bar() | ||
private val y = Bar(2) | ||
} | ||
|
||
object Outer4 { | ||
|
||
object Inner { | ||
class Bar(x: Int): | ||
def this() = this(0) | ||
object Bar | ||
} | ||
|
||
export Inner._ | ||
|
||
val _ = Bar() | ||
val _ = Bar(2) | ||
|
||
} |
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 @@ | ||
object Outer { | ||
|
||
object Inner { | ||
class Bar(x: Int): | ||
def this() = this(0) | ||
} | ||
|
||
export Inner.Bar | ||
} |
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,4 @@ | ||
import Outer._ | ||
|
||
val x = Bar() | ||
val y = Bar(2) |
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,11 @@ | ||
object Outer { | ||
|
||
object Wrap { | ||
export Outer.Bar | ||
} | ||
|
||
class Bar | ||
|
||
val wrapBar = Wrap.Bar() | ||
} | ||
|