File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,19 @@ extension (s: String)
33 def g_:: (x : (suffix : String , n : Int )): String = s " $s${x.suffix * x.n}"
44 def ok_:: (using suffix : String , n : Int ): String = s " $s${suffix * n}"
55 def no_:: (suffix : String , n : Int ): String = s " $s${suffix * n}" // error
6+ def huh_:: (using DummyImplicit )(suffix : String , n : Int ): String = s " $s${suffix * n}"
7+
8+ def local =
9+ extension (s : String ) def f_:: (using DummyImplicit ): String = s.reverse
10+ " hello, world" .f_::
611
712@ main def Test =
813 println :
914 " hello, world" .f_::
15+ println :
16+ f_: :
17+ (" hello, world" )
18+ (using DummyImplicit .dummyImplicit)
1019 println :
1120 (suffix = " s" , n = 3 ).g_:: (" hello, world" )
1221 println :
@@ -15,3 +24,5 @@ extension (s: String)
1524 given String = " s"
1625 given Int = 3
1726 " hello, world" .ok_::
27+ println :
28+ " hello, world" .huh_:: (" s" , 3 )
You can’t perform that action at this time.
0 commit comments