Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow macros in classes #4803

Closed
nicolasstucki opened this issue Jul 18, 2018 · 0 comments
Closed

Allow macros in classes #4803

nicolasstucki opened this issue Jul 18, 2018 · 0 comments

Comments

@nicolasstucki
Copy link
Contributor

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.

@nicolasstucki nicolasstucki self-assigned this Jul 18, 2018
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 23, 2018
Allow top-level ~ in and non static inline method:
* Class methods (including inner and anonymous classes)
* Methods in def/val/var
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 23, 2018
Allow top-level ~ in and non static inline method:
* Class methods (including inner and anonymous classes)
* Methods in def/val/var
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 26, 2018
Allow top-level ~ in and non static inline method:
* Class methods (including inner and anonymous classes)
* Methods in def/val/var
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 26, 2018
Allow top-level ~ in and non static transparent method:
* Class methods (including inner and anonymous classes)
* Methods in def/val/var
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 27, 2018
Allow top-level ~ in and non static transparent method:
* Class methods (including inner and anonymous classes)
* Methods in def/val/var
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 27, 2018
Allow top-level ~ in and non static transparent method:
* Class methods (including inner and anonymous classes)
* Methods in def/val/var
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 27, 2018
Allow top-level ~ in and non static transparent method:
* Class methods (including inner and anonymous classes)
* Methods in def/val/var
nicolasstucki referenced this issue Jul 30, 2018
Enable macros in any transparent def
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant