Last active
December 16, 2018 01:23
-
-
Save xuwei-k/ebee7db618dd115871dbba94a725bc60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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