syntax - scala coalesces multiple function call parameters into a Tuple -- can this be disabled? -


This is an annoying violation of type protection in my project, so I'm exploring a way to disable it That if a function takes any AnyRef (or java.lang.Object), you can call the function with any combination of parameters, and the scalar will collect the parameter in a taple object and invite the function.

The function in my case is not expecting a tuple, and fails at runtime. I expect this situation to be caught in the time of compilation.

  object WhyTuple {def Main (Args: array [string]): unit = {Fuite ("foo", "bar")} output:  
  (Foo, bar)     pre-> 

< P> It does not matter whether the drama or the prepaid anyway - just the good old fashioned compiler you can find it in. I can not see it in the imagination right now.

If you are sufficiently motivated, you can add the compiler-X option to stop this.

Alternatively, avoid avoiding ERT-1 methods that accept the overflow of toplex .


Comments