-
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.
Backport "Retain default parameters with
export
" to LTS (#21064)
Backports #20167 to the LTS branch. PR submitted by the release tooling. [skip ci]
- Loading branch information
Showing
6 changed files
with
31 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
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,5 @@ | ||
object A: | ||
def defaultParam(x: Int = 1) = x | ||
|
||
object Exported: | ||
export A.* |
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,2 @@ | ||
object B: | ||
val x = Exported.defaultParam() |
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,13 @@ | ||
[[syntax trees at end of typer]] // tests/printing/export-param-flags.scala | ||
package <empty> { | ||
final lazy module val A: A = new A() | ||
final module class A() extends Object() { this: A.type => | ||
inline def inlinedParam(inline x: Int): Int = x.+(x):Int | ||
} | ||
final lazy module val Exported: Exported = new Exported() | ||
final module class Exported() extends Object() { this: Exported.type => | ||
export A.* | ||
final inline def inlinedParam(inline x: Int): Int = A.inlinedParam(x) | ||
} | ||
} | ||
|
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,5 @@ | ||
object A: | ||
inline def inlinedParam(inline x: Int): Int = x + x | ||
|
||
object Exported: | ||
export A.* |