You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the rewrite of right-associative operators as described in 6.12.3 it's effectively impossible to write a nonstrict right-associative operator; anything you pass will get forced.
I'm guessing this has been reported before and can't be fixed because it would change the meaning of a lot of code, but I couldn't find an obvious duplicate.
// Surprising behaviorobjectWATextendsApp {
objectFoo {
def!:(n: =>Any) ="foo"
}
lazyvala= { println("AAA"); 1 }
lazyvalb= { println("BBB"); 1 }
Foo.`!:`(a) // ok
b !:Foo// rewritten as { val x = b; Foo.`!:`(x) } // per 6.12.3 and thus forces `b`, oops
}
// output is BBB
The text was updated successfully, but these errors were encountered:
Due to the rewrite of right-associative operators as described in 6.12.3 it's effectively impossible to write a nonstrict right-associative operator; anything you pass will get forced.
I'm guessing this has been reported before and can't be fixed because it would change the meaning of a lot of code, but I couldn't find an obvious duplicate.
The text was updated successfully, but these errors were encountered: