You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_docs/reference/other-new-features/export.md
+3-37Lines changed: 3 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -162,11 +162,9 @@ extension (x: String)
162
162
privatedefmoreOps=newStringOps(x)
163
163
exportmoreOps.*
164
164
```
165
-
In this case the qualifier expression must be an identifier that refers to a unique parameterless extension method in the same extension clause.
166
-
167
-
An export will then create extension methods for all accessible term members,
168
-
matching the selectors, in the result of the qualifier path.
169
-
For instance, the extension above would be expanded to
165
+
In this case the qualifier expression must be an identifier that refers to a unique parameterless extension method in the same extension clause. The export will create
166
+
extension methods for all accessible term members
167
+
in the result of the qualifier path. For instance, the extension above would be expanded to
170
168
```scala
171
169
extension (x: String)
172
170
deftake(n: Int):String= x.substring(0, n)
@@ -176,38 +174,6 @@ extension (x: String)
176
174
defcapitalize:String= moreOps.capitalize
177
175
```
178
176
179
-
### A Note on Exporting Extension Methods
180
-
**Note:** extension methods can have surprising results if exported from within an extension (i.e. they
181
-
are exported as-if they were an ordinary method). Observe the following example:
0 commit comments