Skip to content

Commit 733b011

Browse files
bishaboshaodersky
authored andcommitted
add forwardCompat test for export in extension
1 parent 5749a3c commit 733b011

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
case class ShortString(value: String)
2+
3+
class StringOps(x: ShortString):
4+
def *(n: Int): ShortString = ???
5+
def capitalize: ShortString = ???
6+
7+
object stringsyntax:
8+
9+
extension (x: ShortString)
10+
def take(n: Int): ShortString = ???
11+
def drop(n: Int): ShortString = ???
12+
private def moreOps = StringOps(x)
13+
export moreOps.*
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import stringsyntax.*
2+
3+
def test =
4+
ShortString("Hello").take(2)
5+
ShortString("Hello").drop(3)
6+
ShortString("Hello") * 5
7+
ShortString("Hello").capitalize

0 commit comments

Comments
 (0)