Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Last active December 16, 2018 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/ebee7db618dd115871dbba94a725bc60 to your computer and use it in GitHub Desktop.
Save xuwei-k/ebee7db618dd115871dbba94a725bc60 to your computer and use it in GitHub Desktop.
scala -Ywarn-adapted-args -language:_
Welcome to Scala 2.12.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_192).
Type in expressions for evaluation. Or try :help.
scala> def printInt(i: Int) = println(i)
printInt: (i: Int)Unit
scala> implicit def toOneInt(is: (Int, Int)): Int = is._1 + is._2
toOneInt: (is: (Int, Int))Int
scala> printInt(10, 20)
<console>:14: warning: Adapting argument list by creating a 2-tuple: this may not be what you want.
signature: printInt(i: Int): Unit
given arguments: 10, 20
after adaptation: printInt((10, 20): Int)
printInt(10, 20)
^
30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment