Skip to content

Regression in m2-oss/calypso - rhs of a given with type bounded param unable to resolve certain other givens #19407

Closed
@jchyb

Description

@jchyb

Compiler version

3.4.0-RC1-bin-20240104-2746ee8-NIGHTLY (last successful build 3.4.0-RC1-bin-20231207-16f1680-NIGHTLY), via the community build: https://github.com/VirtusLab/community-build3/actions/runs/7427597656/job/20238015937

Minimized code

trait GeneratedEnum
trait Decoder[A]

object Decoder:
  given Decoder[Int] = ???

object GeneratedEnumDecoder:

  given [A <: GeneratedEnum]: Decoder[A] =
    summon[Decoder[Int]]
    ???

Output

[error] -- [E172] Type Error: /Users/jchyb/Documents/workspace/calypso/modules/scalapb/src/main/scala/ru/m2/calypso/scalapb/GeneratedEnumDecoder.scala:10:24 
[error] 10 |    summon[Decoder[Int]]
[error]    |                        ^
[error]    |No given instance of type Decoder[Int] was found for parameter x of method summon in object Predef.
[error]    |I found:
[error]    |
[error]    |    GeneratedEnumDecoder.given_Decoder_A[A]
[error]    |
[error]    |But given instance given_Decoder_A in object GeneratedEnumDecoder does not match type Decoder[Int].
[error] one error found

Expectation

no errors

Metadata

Metadata

Assignees

Labels

area:implicitsrelated to implicitsitype:bugregressionThis worked in a previous version but doesn't anymore

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions