[error] :1: missing parameter type for expanded function
[error] The argument types of an anonymous function must be fully known. (SLS 8.5)
[error] Expected type was: ?
[error] {case t:Throwable => subscript.DSL._maybeVarCall("t.printStackTrace()")}
[error] ^
[error] one error found
This issue may and should be solved when we move the preprocessor back to the compiler.
Due to the fact that everything in code fragments end up in various macros in small pieces, catch {case t:Throwable => t.printStackTrace()} becomes catch subscript.DSL._maybeVarCall("{case t:Throwable => subscript.DSL._maybeVarCall(\"t.printStackTrace()\")}") and hence is processed as a separate PartialFunction, outside try's context. Hence we need to specify its type explicitly, so that it rewrites to catch subscript.DSL._maybeVarCall("{case t:Throwable => subscript.DSL._maybeVarCall(\"t.printStackTrace()\")}"): PartialFunction[Throwable, Unit].
(...)
So far, macros wrap statements non-selectively, they don't have the context information and can't see they operate in try-catch. This is not the most elegant solution, of course, but I couldn't think of anything better using only macros and the parser.
Yields:
This issue may and should be solved when we move the preprocessor back to the compiler.
Temporary workaround:
Earlier reported here. Anatolii wrote: