Hi everyone, I'm seeing some weird behavior when p...
# arrow-meta
m
Hi everyone, I'm seeing some weird behavior when printing the body of named functions that span multiple lines.
Copy code
fun test() {
    println("Testing...")
    val a = 1
    val b = 2
}

val Meta.myPlugin: CliPlugin
    get() =
        "Plugin" {
            meta(namedFunction(this, { name == "test" }) { function ->
                error(body)
            })
        }
prints
Copy code
println("Testing...")
    val a = 1
    val b = 2
}
{
    println("Testing...")
    val a = 1
    val b = 2
}
{
    println("Testing...")
    val a = 1
    val b = 2
Apparently, it's printing the function's body as many times as it has lines with
}
and
{
in between. Is that a known issue?
r
Hi @Max Härtwig it’s not a known issue. How are you printing the body inside
error
?
m
I just use
error()
to print something to the console, because
println()
doesn't work in my setup.
r
This should not happen unless you have three functions called “test” in the same file but with different signatures so it’s definitely a bug. If you don’t mind reporting it we will address it in the next alpha release.