I'm not sure, but when you use λ in λ"λx.x" , this seems to be considered an operator, and only printable ASCII characters are allowed for operators. So, if you replace λ with something less weird, like l or lambda , it works.
implicit class LambdaContext(val sc: StringContext) extends AnyVal { def l(args: Any*) = λ(args) def λ(args: Any*) = args } scala> l"lx.x" res1: Seq[Any] = List()
source share