Skip to content

Unexpected tuple inferred from dependent typing as an error #15813

Closed
@soronpo

Description

@soronpo

Compiler version

v3.2.0-RC2

Minimized code

https://scastie.scala-lang.org/xebUkPLdQUKL9V8Q4Kdyhg

class Box[T]
def dep1[T1 <: Singleton, T2 <: T1](t1: T1)(t2: T2): Box[T1] = ???
val d1 = dep1(1)(2) //error

Output

Found:    Box[(1 : Int) | (2 : Int)]
Required: Box[((1 : Int) | (2 : Int))]

Expectation

Type mismatch for t2.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions