Skip to content

Chain of two given...with fail to fetch dependent type  #13580

Open
@soronpo

Description

@soronpo

Chain of two given..with dependencies fail to fetch dependent type. If IntCandidate in the example below uses transparent inline given then there is no error.

Compiler version

v3.1.0-RC2

Minimized code

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

trait IntWidth {type Out}
given IntWidth with {type Out = 155}

trait IntCandidate {type Out}
given (using w: IntWidth): IntCandidate with {type Out = w.Out}

val x = summon[IntCandidate]
val xx = summon[x.Out =:= 155]

Output

Cannot prove that x.Out =:= (155 : Int).

Expectation

No error.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions