Skip to content

Surface.methodsOf - assertion failed: Tree had an unexpected owner for method #3367

@OndrejSpanel

Description

@OndrejSpanel

When building project from https://github.com/OndrejSpanel/Scala3KeyNotFound with -Xcheck-macros, an assertion is shown:

java.lang.AssertionError: assertion failed: Tree had an unexpected owner for method $anonfun
Expected: val __s001 (InjectScript$.ScriptX.$$__s001)
|But was: val macro (InjectScript$.ScriptX._$macro)

The project is:

import wvlet.airframe.surface.*

class InjectScript(x: Seq[MethodSurface])

class XParams[+T](params: Map[String, T])

object InjectScript {
  trait Params {
    def getParams: XParams[Unit]
  }

  class ScriptX extends InjectScript(Surface.methodsOf[Params])
}

When building without the option, Scala 3 compiler crashes (reported as scala/scala3#19575)

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