The following program gives a good result and a bad result.
Why is the extension failing ? What is specific wrong ?
def compose1[A, B, C](f: B => C, g: A => B): A => C =
x => f(g(x))
def add2(n:Int):Int = n+100
def mul3(n:Int):Int = n*33
extension [A,B] (x: A => B) def compose2[C](g:B => C): A=> C = y => g(x(y))
@main private def main(args: String*): Int =
val x= (compose1 (mul3,add2)) (0)
val y= add2 compose mul3
val z= y(0)
println(x) // OK
println(z) // ERROR FUNCTION mul3 not run
0