scala.Predef

MacroCompiler

trait MacroCompiler extends AnyRef

Type class which abstracts compilation of macro defs.

Previously macro defs were linked to macro impls using hardcoded logic in Macros.scala. This logic took the right-hand side of a macro def, typechecked it as a reference to a static method and then used that method as a corresponding macro implementation.

Now compilation of macro defs is fully extensible. Instead of using a hardcoded implementation to look up macro impls, the macro engine performs an implicit search of a MacroCompiler in scope and then invokes its resolveMacroImpl method, passing it the DefDef of a macro def and expecting a reference to a static method in return. Of course, resolveMacroImpl should itself be a macro, namely an untyped one, for this to work.

Default instance of the type class, Predef.DefaultMacroCompiler, implements formerly hardcoded typechecking logic. Alternative implementations could for instance provide lightweight syntax for macro defs, generation macro impls on-the-fly using c.introduceToplevel.

Source
Predef.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MacroCompiler
  2. AnyRef
  3. Any
Implicitly
  1. by StringAdd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  5. by StringAdd
  6. by StringFormat
  7. by Ensuring
  8. by ArrowAssoc
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. def resolveMacroImpl(macroDef: <untyped>): <untyped>

  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  19. def toString(): java.lang.String

    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Shadowed Implicit Value Members

  1. def +(other: String): java.lang.String

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to StringAdd[MacroCompiler] performed by method StringAdd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: StringAdd[MacroCompiler]).+(other)
    Definition Classes
    StringAdd
  2. def +(other: String): java.lang.String

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to StringAdd[MacroCompiler] performed by method StringAdd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: StringAdd[MacroCompiler]).+(other)
    Definition Classes
    StringAdd
  3. def ->[B](y: B): (MacroCompiler, B)

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to ArrowAssoc[MacroCompiler] performed by method ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: ArrowAssoc[MacroCompiler]).->(y)
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  4. def ->[B](y: B): (MacroCompiler, B)

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to ArrowAssoc[MacroCompiler] performed by method ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: ArrowAssoc[MacroCompiler]).->(y)
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. def ensuring(cond: (MacroCompiler) ⇒ Boolean, msg: ⇒ Any): MacroCompiler

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to Ensuring[MacroCompiler] performed by method Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: Ensuring[MacroCompiler]).ensuring(cond, msg)
    Definition Classes
    Ensuring
  6. def ensuring(cond: (MacroCompiler) ⇒ Boolean): MacroCompiler

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to Ensuring[MacroCompiler] performed by method Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: Ensuring[MacroCompiler]).ensuring(cond)
    Definition Classes
    Ensuring
  7. def ensuring(cond: Boolean, msg: ⇒ Any): MacroCompiler

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to Ensuring[MacroCompiler] performed by method Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: Ensuring[MacroCompiler]).ensuring(cond, msg)
    Definition Classes
    Ensuring
  8. def ensuring(cond: Boolean): MacroCompiler

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to Ensuring[MacroCompiler] performed by method Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: Ensuring[MacroCompiler]).ensuring(cond)
    Definition Classes
    Ensuring
  9. def ensuring(cond: (MacroCompiler) ⇒ Boolean, msg: ⇒ Any): MacroCompiler

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to Ensuring[MacroCompiler] performed by method Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: Ensuring[MacroCompiler]).ensuring(cond, msg)
    Definition Classes
    Ensuring
  10. def ensuring(cond: (MacroCompiler) ⇒ Boolean): MacroCompiler

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to Ensuring[MacroCompiler] performed by method Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: Ensuring[MacroCompiler]).ensuring(cond)
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ Any): MacroCompiler

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to Ensuring[MacroCompiler] performed by method Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: Ensuring[MacroCompiler]).ensuring(cond, msg)
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): MacroCompiler

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to Ensuring[MacroCompiler] performed by method Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: Ensuring[MacroCompiler]).ensuring(cond)
    Definition Classes
    Ensuring
  13. def formatted(fmtstr: String): String

    Returns string formatted according to given format string.

    Returns string formatted according to given format string. Format strings are as for String.format (@see java.lang.String.format).

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to StringFormat[MacroCompiler] performed by method StringFormat in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: StringFormat[MacroCompiler]).formatted(fmtstr)
    Definition Classes
    StringFormat
    Annotations
    @inline()
  14. def formatted(fmtstr: String): String

    Returns string formatted according to given format string.

    Returns string formatted according to given format string. Format strings are as for String.format (@see java.lang.String.format).

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to StringFormat[MacroCompiler] performed by method StringFormat in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: StringFormat[MacroCompiler]).formatted(fmtstr)
    Definition Classes
    StringFormat
    Annotations
    @inline()
  15. def [B](y: B): (MacroCompiler, B)

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to ArrowAssoc[MacroCompiler] performed by method ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: ArrowAssoc[MacroCompiler]).→(y)
    Definition Classes
    ArrowAssoc
  16. def [B](y: B): (MacroCompiler, B)

    Implicit information
    This member is added by an implicit conversion from MacroCompiler to ArrowAssoc[MacroCompiler] performed by method ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (macroCompiler: ArrowAssoc[MacroCompiler]).→(y)
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion StringAdd from MacroCompiler to StringAdd[MacroCompiler]

Inherited by implicit conversion StringFormat from MacroCompiler to StringFormat[MacroCompiler]

Inherited by implicit conversion Ensuring from MacroCompiler to Ensuring[MacroCompiler]

Inherited by implicit conversion ArrowAssoc from MacroCompiler to ArrowAssoc[MacroCompiler]

Inherited by implicit conversion StringAdd from MacroCompiler to StringAdd[MacroCompiler]

Inherited by implicit conversion StringFormat from MacroCompiler to StringFormat[MacroCompiler]

Inherited by implicit conversion Ensuring from MacroCompiler to Ensuring[MacroCompiler]

Inherited by implicit conversion ArrowAssoc from MacroCompiler to ArrowAssoc[MacroCompiler]

Ungrouped