-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Milestone
Description
% scala210 -Ywarn-adapted-args -Xfatal-warnings -e 'def foo(a: Any) = a; foo(1, 2)'
# Warning expected here.
% scala210 -Ywarn-adapted-args -Xfatal-warnings -e 'def foo[A](a: Any) = a; foo(1, 2)'
/var/folders/xq/4pqxykpn5n56mngmch4p5xgw0000gn/T/scalacmd4298701803865603272.scala:1: error: Adapting argument list by creating a 2-tuple: this may not be what you want.
signature: $anon.foo[A](a: Any): Any
given arguments: 1, 2
after adaptation: $anon.foo((1, 2): (Int, Int))
def foo[A](a: Any) = a; foo(1, 2)
^
one error found
% scala210 -Yno-adapted-args -e 'def foo[A](a: Any) = a; foo(1, 2)'
/var/folders/xq/4pqxykpn5n56mngmch4p5xgw0000gn/T/scalacmd5030784570605432719.scala:1: warning: No automatic adaptation here: use explicit parentheses.
signature: $anon.foo[A](a: Any): Any
given arguments: 1, 2
after adaptation: $anon.foo((1, 2): (Int, Int))
def foo[A](a: Any) = a; foo(1, 2)
^
/var/folders/xq/4pqxykpn5n56mngmch4p5xgw0000gn/T/scalacmd5030784570605432719.scala:1: error: too many arguments for method foo: (a: Any)Any
def foo[A](a: Any) = a; foo(1, 2)
^
one warning found
one error found
% scala210 -Yno-adapted-args -e 'def foo(a: Any) = a; foo(1, 2)'
/var/folders/xq/4pqxykpn5n56mngmch4p5xgw0000gn/T/scalacmd8192043649954446982.scala:1: error: too many arguments for method foo: (a: Any)Any
def foo(a: Any) = a; foo(1, 2)
^
one error found
Metadata
Metadata
Assignees
Labels
No labels