scala - Warning on multiple assignment -


suppose have

def f() = (1, 2, 3) 

somewhere in code call it:

val (a, b, c) = f() 

but can confused multiple assignments:

val a, b, c = f() // here every variable == (1, 2, 3) 

moreover, have never used multiple assignments feature. reasons above think it's harmful. possible make compiler warn on it?

the direct answer question no. said, if want build compiler plugin this, can achieve goal of issuing warning. said, how build compiler plugin beyond scope of answer here.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -