Skip to content

Regression in softwaremill/sttp - ignored overloaded member #19006

Closed
@WojciechMazur

Description

@WojciechMazur

Open Community Builder failure based on the following projects:

Compiler version

3.4.0-RC1-bin-20231117-5bb6f0d-NIGHTLY

Bisect points to 171773d

Minimized code

import java.util.Map.Entry;
import java.util.function.BiConsumer;
import java.lang.Iterable

trait HttpHeaders extends Iterable[Entry[String, String]] {
  def forEach(action: BiConsumer[String, String]): Unit = ???
}

@main def Test =
  val headers: HttpHeaders = ???
  headers.forEach((a, b) => ???)

Output

-- [E086] Syntax Error: /Users/wmazur/projects/dotty/bisect/main.scala:11:25 ---
11 |  headers.forEach((a, b) => ???)
   |                  ^^^^^^^^^^^^^
   |                  Wrong number of parameters, expected: 1
   |

Expectation

Should compile. Compiler should use the overloaded variant of forEach method taking a BiConsumer instead of Consumer[Entry[String,String] defined in Java stdlib.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions