scala> List(1,2,3).toSet()res0: Boolean = false
lint says:<console>:8: warning: Adapting argument list by inserting (): this is unlikely to be what you want.signature: GenSetLike.apply(elem: A): Booleangiven arguments: <none>after adaptation: GenSetLike((): Unit)List(1,2,3).toSet()^
doesn't work “of course”Type-safe contains FTW.
Here's an interesting look at the adhocity of the implementation. Why do these issue different errors?
I have no idea, but actually I'm even more confused by the question why scalac doesn't try to “adapt the argument list by inserting ()” in these two cases.
To be clear, I didn't intend this as an example of doing something useful. Only as an example of doing something.