How to make such an assignment possible. = returns unit.
val x, y = 1
Conclusion:
>>x: Int = 1 >>y: Int = 1
In fact, x is Unit in this case ::
x
Unit
var y = 2 var x = y = 1
Can be read as:
var y = 2 var x = (y = 1)
and finally:
var x: Unit = ()
You can go to type x = y = 1 in the REPL shell without errors:
var x:Unit = {} var y = 0 x = y = 1
Source: https://ru.stackoverflow.com/questions/674961/More articles:What to do if the sniffer displays only packets using the UDP protocol?Trying to load the gem 'activerecord-nulldb-adapter'Typescript indexerstd :: function, error C2679The file_get_contents request reports “Connection timed out”, it works with curlHow to parse pictures from a specific Instagram account into my iOS application?Replacing characters in the char array - CDoes not work preg_replace [closed]504 Gateway Time-out WinginxHow to make a closure in the drop-down menu?All Articles