Skip to content

Subtype relation for refined type fails #481

@thierry-st

Description

@thierry-st

izumi.reflect.Tag subtype relationship is not faithful to compiled ones.

Here is a minimal repro (Scala 2 syntax to allow testing various versions):

import izumi.reflect.Tag

trait A {
  type T
}

trait AInt extends A {
  override type T = Int
}

object App extends App {
  implicitly[AInt <:< A { type T = Int }] // true
  println(Tag[AInt].tag <:< Tag[A { type T = Int }].tag) // false
}

Scastie link

It might be more efficient to tackle this issue and #469 both at once, but they seemed different enough to me to warrant different posts.

It might help to know that the issue is not present for Scala >= 3.2 and izumi-reflect =< 2.2.5. But the issue is present if violating any of these bounds (Scala 2 and/or izumi-reflect >= 2.3.0).

I will report soon the corresponding issue on the ZIO repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions