Johannes Rudolph
unread,May 7, 2013, 11:20:18 AM5/7/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Som Snytt, Naftoli Gugenheim, pschaus, scala-user, Sascha Van Cauwelaert
On Tue, May 7, 2013 at 4:43 PM, Som Snytt <
som....@gmail.com> wrote:
> I'd guess the difference for the Unit CBN case is SLS 5.1.1
Good catch!
> It's also refreshing to hear, on the issue thread, "This won't happen."
I'm not completely sure what "This won't happen." related to. IMO the
sane thing to do wouldn't be allowing more syntax as suggested in the
issue but restricting the rules in a way which disallows the effect
seen here (i.e. that `new D` is valid).
And now I know why it works the way it does (-Ywarn-adapted-args):
scala> class C(x: => Unit)
defined class C
scala> new C()
<console>:9: warning: Adapting argument list by inserting (): this is
unlikely to be what you want.
signature: C(x: => Unit): C
given arguments: <none>
after adaptation: new C((): Unit)
new C()
^
It's the auto-tupling converting the empty parameter list into the
0-tuple. In which cases is this what you want to do?