compiler errors - Scala declare multiple variables at the same row with the first character as upper-case -


i'm trying declare variables through tuple-assignment, such as:

val (hi, bye) = ("hi", "bye") 

and fine. when having first character upper-case, compiler explodes , complains these variables not being defined.

val (hi, bye) = ("hi", "bye") 

why doesn't work? i'm running scala 2.11.

by way works (as expected):

val hi = "hi" val bye = "bye" 

from here:

the tuple on left-hand side pattern; names starting capital letters treated constants when occurring inside pattern. these constants must exist values in context. find exact semantics in scala spec under pattern matching.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -