Skip to content

Unintuitive malformed macro error and IFT #5840

Closed
@biboudis

Description

@biboudis

Refactoring an inline method like i5_1, into i5_2 seems natural. Since the RHS is a complex block this is not permitted.

object Test {
  case class Ctx()
  type Contextual[T] = given Ctx => T
  inline def i5_1[T](n: T)(implicit thisCtx: Ctx): T = ${ 'n } // OK
  inline def i5_2[T](n: T): Contextual[T] = ${ println(); 'n } // error: malformed macro
}

What would be better: to let it pass it through or just improve the error message?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions