wvlet / airframe

Essential Building Blocks for Scala
https://wvlet.org/airframe
Apache License 2.0
631 stars 64 forks source link

surface (fix): Fixed a bug in getting a surface of inner opaque type #3521

Closed OndrejSpanel closed 2 months ago

OndrejSpanel commented 2 months ago

The PR contains a failing test demonstrating issue. Following code fails:

  object O:
    opaque type InnerOpaque = Double

  test("Opaque types from inner object") {
    val s = Surface.of[O.InnerOpaque]
  }

The error is:

java.util.NoSuchElementException: key not found: wvlet.airframe.surface.Scala3NewTypeTest.O.InnerOpaque

I will try to create a fix.

OndrejSpanel commented 2 months ago

The opaque type aliases need the same handling for inner types which normal type aliases already had.

xerial commented 2 months ago

Thanks for the fix. Merged