I’m wondering why this compiles and runs. Is it related to omitting parentheses Feature maybe?
Welcome to the Ammonite Repl 1.1.2 (Scala 2.12.6 Java 1.8.0_172) If you like Ammonite, please support our development at www.patreon.com/lihaoyi @ def test(n: Unit): Int = 32 defined function test @ test(1111) res1: Int = 32 @ test("blabla") res2: Int = 32
It is obviously a contrived example. I don’t understand why that works, can maybe someone tell me what the compiler does here?
Thank you and kind regards