You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes the missing error on the sequence argument ascription makes it hard to spot the problem.
scala>importcollection.mutable.ListBuffer
scala>valxs=ListBuffer.empty[Int]
valxs: scala.collection.mutable.ListBuffer[Int] =ListBuffer()
scala> xs.+=(1, 2, 3, List(4,5,6) ++List(7,8,9):_*)
1|xs.+=(1, 2, 3, List(4,5,6) ++List(7,8,9):_*)
|^^^^^^^^^^^^^^^^^^^^^^^^^^|Found:List[Int]
|Required:Int
scala> xs.+=(1, 2, List(4,5,6) ++List(7,8,9):_*)
1|xs.+=(1, 2, List(4,5,6) ++List(7,8,9):_*)
|^^^^^|method += in traitGrowable is deprecated since 2.13.0:Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated
valres0: scala.collection.mutable.ListBuffer[Int] =ListBuffer(1, 2, 4, 5, 6, 7, 8, 9)
Expectation
➜ dotty git:(master) scala
Welcome to Scala2.13.3 (OpenJDK64-BitServerVM, Java14.0.2).
Type in expressions for evaluation. Ortry:help.
scala>List(1, List(2):_*)
^error: no `:_*' annotation allowed here
(such annotations are only allowed in arguments to *-parameters)
Minimized code
Output
Sometimes the missing error on the sequence argument ascription makes it hard to spot the problem.
Expectation
This is a follow-up to #9749 inspired by #10062
The text was updated successfully, but these errors were encountered: