Closed japgolly closed 3 years ago
@japgolly was a warning emitted in the real case you encountered? If not, then that's a clear bug.
Reg. this particular issue - pure expressions in statement positions are, in my experience, almost always completely unintentional, so maybe we could make the warning an error. It might make sense to emit a special error on eta-expansion, but that feels a bit too specific for me.
I commented on the PR that the optimal behavior might be different for a REPL, where you do typically ask, What does this eta-expand to? Or does it even? Thread.sleep
.
But I think repls embed in a val definition anyway, so that should be ok
Compiler version
3.0.0-RC1
Minimized code
Output
Expectation
The code shouldn't compile. The
go
function requires an explicitx
argument. It's probably convertinggo
to a function literal which is normally fine, but doesn't make sense if its the entirely of the statement and not a return value.(Also keep in mind that this is the minimised case, the real case I encountered was much more confusing and dangerous.)