Skip to content

Allow macros in classes #4803

Closed
Closed
@nicolasstucki

Description

@nicolasstucki

We should support macros defined in classes

class Num(x: Double) {
  inline def power(inline n: Long) = ~PowerMacro.powerCode(n, '(x))
}
object PowerMacro {
  def powerCode(n: Long, x: Expr[Double]): Expr[Double] = ...
}

The dificulty is that the contents of PowerMacro.powerCode(n, '(x)) need to be placed in some static method.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions