Skip to content

Allow multiple splices in macros #4801

Closed
@nicolasstucki

Description

@nicolasstucki

We want to be able to write macros that have several top level splices such as

inline def foo(b: Boolean): Int = {
  if (b) ${bar(true)}
  else ${bar(false)}
}
def bar(b: Boolean)(using QuoteContext): Expr[Int] = if (b) '{1} else '{0}

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