Skip to content

[SIP-71] into[A] type wrapper lost in mirror generation #23400

Open
@prolativ

Description

@prolativ

Compiler version

3.7.3-RC1-bin-20250619-b1da8fc-NIGHTLY

Minimized code

import scala.language.experimental.into
import Conversion.into

import scala.deriving.Mirror

object Opaques:
  opaque into type MyInto[+A] >: A = A

import Opaques.MyInto

case class Foo(x: Int)
case class Bar(foo: into[Foo])
case class Baz(foo: MyInto[Foo])

given Conversion[Int, Foo] = Foo(_)

def test = 
  val barMirror = summon[Mirror.Of[Bar]]
  summon[barMirror.MirroredElemTypes =:= (into[Foo] *: EmptyTuple.type)] // Doesn't compile unexpectedly
  summon[barMirror.MirroredElemTypes =:= (Foo *: EmptyTuple.type)] // Compiles unexpectedly

  val bazMirror = summon[Mirror.Of[Baz]]
  summon[bazMirror.MirroredElemTypes =:= (MyInto[Foo] *: EmptyTuple.type)] // Compiles as expected
  summon[bazMirror.MirroredElemTypes =:= (Foo *: EmptyTuple.type)] // Doesn't compile as expected

Expectation

into type should be preserved in mirror generation

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions