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
Post a Comment