Created
March 5, 2020 05:50
-
-
Save danieldietrich/6bf806f7359fbf9e6ba8b75296352cf3 to your computer and use it in GitHub Desktop.
StringContextExtensions
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
On line 3: error: type mismatch; | |
found : StringContextExtensions.this.sc.s.type | |
required: Seq[Any] => String | |
def xraw(args: Any*): String = align(sc.raw, args) | |
^ | |
On line 5: error: too few argument lists for macro invocation |
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
implicit class StringContextExtensions(private val sc: StringContext) extends AnyVal { | |
def xs(args: Any*): String = align(sc.s, args) | |
def xraw(args: Any*): String = align(sc.raw, args) | |
private def align(interpolator: Seq[Any] => String, args: Any*): String = "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment