diff --git a/docs/docs/reference/other-new-features/export.md b/docs/docs/reference/other-new-features/export.md index 5ded49aebc75..a61cf1feb1e3 100644 --- a/docs/docs/reference/other-new-features/export.md +++ b/docs/docs/reference/other-new-features/export.md @@ -23,7 +23,7 @@ class Copier: private val scanUnit = new Scanner export scanUnit.scan - export printUnit.{status => _, _} + export printUnit.{status => _, *} def status: List[String] = printUnit.status ++ scanUnit.status ``` @@ -58,7 +58,7 @@ of one of the following forms: - An _omitting selector_ `x => _` prevents `x` from being aliased by a subsequent wildcard selector. - A _given selector_ `given x` has an optional type bound `x`. It creates aliases for all eligible given instances that conform to either `x`, or `Any` if `x` is omitted, except for members that are named by a previous simple, renaming, or omitting selector. - - A _wildcard selector_ `_` creates aliases for all eligible members of `path` except for given instances, + - A _wildcard selector_ `*` creates aliases for all eligible members of `path` except for given instances, synthetic members generated by the compiler and those members that are named by a previous simple, renaming, or omitting selector. A member is _eligible_ if all of the following holds: @@ -144,15 +144,15 @@ Consider the following example: ```scala class B { val c: Int } object a { val b = new B } -export a._ -export b._ +export a.* +export b.* ``` -Is the `export b._` clause legal? If yes, what does it export? Is it equivalent to `export a.b._`? What about if we swap the last two clauses? +Is the `export b.*` clause legal? If yes, what does it export? Is it equivalent to `export a.b.*`? What about if we swap the last two clauses? ``` -export b._ -export a._ +export b.* +export a.* ``` To avoid tricky questions like these, we fix the elaboration order of exports as follows.