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()^
scala> Set(1,2,3)()
doesn't work “of course”
scala> Set(1,2,3)()
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.
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To be clear, I didn't intend this as an example of doing something useful. Only as an example of doing something.