Is it an issue need to be resolved? += (("a", 1))
#20066
dongxuwang
started this conversation in
General Discussion
Replies: 2 comments
-
Apparently, we untuple tuple arguments of infix operations if the function does not consist only of unary alternatives. trait Buffer1[A]:
def += (elem: A): Buffer1[A]
val b1: Buffer1[(String, Int)] = ???
b1 += ("a", 1) // Ok
trait Buffer2[A]:
def += (elem: A): Buffer2[A]
def += (elem1: A, elem2: A): Buffer2[A]
val b2: Buffer2[(String, Int)] = ???
b2 += ("b", 2) // Error scala3/compiler/src/dotty/tools/dotc/typer/Applications.scala Lines 1231 to 1239 in 6bb6b43 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Since the alternative The current nice syntax is |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For
+=
with tuple, why I have to add()
to wrap the tuple valueBeta Was this translation helpful? Give feedback.
All reactions