Skip to content

"Wrong number of parameters" error in for expression under -source: future #14626

Closed
@griggt

Description

@griggt

Compiler version

3.1.2-RC1

Minimized code

Welcome to Scala 3.1.2-RC1 (1.8.0_292, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> :settings -source:future
scala> for (a, b) <- List("a","b","c").lazyZip(List(1,2,3)) do println(s"$a$b")

Output

-- [E086] Syntax Error: --------------------------------------------------------
1 |for (a, b) <- List("a","b","c").lazyZip(List(1,2,3)) do println(s"$a$b")
  |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |    Wrong number of parameters, expected: 2
1 error found

Expectation

a1
b2
c3

Noticed at #14294 (comment)

Metadata

Metadata

Assignees

Labels

area:desugarDesugaring happens after parsing but before typing, see desugar.scalaitype:bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions