Skip to content

undefined: ...proxy... errors when inlining opaque types #22359

Open
@jchyb

Description

@jchyb

Compiler version

main

Minimized code

opaque type NT[N <: Tuple, V <: Tuple] = V
opaque type System = NT[Tuple1["wires"], Tuple1[Any]]

extension [N <: Tuple, V <: Tuple] (x: NT[N, V]) {
  inline def apply(n: Int): Any =
    x.productElement(n)
}

extension (system: System) {
  inline def foo =
    system.apply(0)
}

val simulation: System = ???
val _ = simulation.foo

Output

-- Error: X1.scala:11:4 --------------------------------------------------------
11 |    system.apply(0)
   |    ^^^^^^^^^^^^
   |undefined: system$proxy1.apply # -1: TermRef(TermRef(NoPrefix,val system$proxy1),apply) at inlining

Expectation

no error

notes

Initially submitted in connection to NamedTuples: #22324 (fixed for NamedTuples only)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions