我知道这个问题以不同的方式出现过很多次.但我现在还不清楚.有没有办法实现以下目标.
def foo(a:Int, b:Int) = {}
foo(a,b) //right way to invoke foo
foo(getParams) // is there a way to get this working without explicitly unpacking the tuple??
def getParams = {
//Some calculations
(a,b) //where a & b are Int
}
Run Code Online (Sandbox Code Playgroud)