From 4a273659e0e25ccfe7ea9d4eafa4a9c87ee2fc82 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sat, 10 Aug 2013 15:16:09 +0200 Subject: kills introduceTopLevel As we've figured out from the practice, introduceTopLevel is seductively useful but unfortunately not robust, potentially bringing compilation order problems. Therefore, as discussed, I'm removing it from the public macro API. Alternatives are either: 1) delving into internals, or 2) using macro paradise and experimenting with macro annotations: http://docs.scala-lang.org/overviews/macros/annotations.html. --- src/reflect/scala/reflect/macros/Context.scala | 3 +- src/reflect/scala/reflect/macros/Synthetics.scala | 107 ---------------------- 2 files changed, 1 insertion(+), 109 deletions(-) delete mode 100644 src/reflect/scala/reflect/macros/Synthetics.scala (limited to 'src/reflect') diff --git a/src/reflect/scala/reflect/macros/Context.scala b/src/reflect/scala/reflect/macros/Context.scala index 434b7c1b9c..b0c816f4ad 100644 --- a/src/reflect/scala/reflect/macros/Context.scala +++ b/src/reflect/scala/reflect/macros/Context.scala @@ -37,8 +37,7 @@ trait Context extends Aliases with Typers with Parsers with Evals - with ExprUtils - with Synthetics { + with ExprUtils { /** The compile-time universe. */ val universe: Universe diff --git a/src/reflect/scala/reflect/macros/Synthetics.scala b/src/reflect/scala/reflect/macros/Synthetics.scala deleted file mode 100644 index 5e422ee89f..0000000000 --- a/src/reflect/scala/reflect/macros/Synthetics.scala +++ /dev/null @@ -1,107 +0,0 @@ -package scala -package reflect -package macros - -/** - * EXPERIMENTAL - * - * A slice of [[scala.reflect.macros.Context the Scala macros context]] that - * exposes functions to introduce synthetic definitions. - * - * @define TOPLEVEL_TREE Top-level tree is a tree that represents a non-inner class or object in one of the currently compiled source files. - * Note that top-level isn't equivalent to [[scala.reflect.api.Symbols#SymbolApi.isStatic]], - * because static also embraces definitions nested in static objects - * - * @define INTRODUCE_TOP_LEVEL Allowed definitions include classes (represented by `ClassDef` trees), traits (represented - * by `ClassDef` trees having the `TRAIT` flag set in `mods`) and objects (represented by `ModuleDef` trees). - * - * The definitions are put into the package with a prototype provided in `packagePrototype`. - * Supported prototypes are (see [[PackageSpec]] for more details): - * * Strings and names representing a fully-qualified name of the package - * * Trees that can work as package ids - * * Package or package class symbols - * - * Typical value for a package prototype is a fully-qualified name in a string. - * For example, to generate a class available at `foo.bar.Test`, call this method as follows: - * - * introduceTopLevel("foo.bar", ClassDef(, TypeName("Test"), ,