Skip to content

Commit f126f40

Browse files
committed
prepares our macro defs for refactoring (Step II)
Since the previous commit the compiler doesn't need any help to find out that fast-tracked macros are macros. Hence I'm replacing their RHSes with the universal ??? body. This way macro definitions defined in scala (for example, tag materialization macros or certain string formatters) won't stand in the way of the changes to the macro system.
1 parent 280c490 commit f126f40

File tree

7 files changed

+7
-17
lines changed

7 files changed

+7
-17
lines changed

src/compiler/scala/reflect/reify/package.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package scala.reflect
22

33
import language.implicitConversions
4-
import language.experimental.macros
54
import scala.reflect.base.{Universe => BaseUniverse}
65
import scala.reflect.makro.{Context, ReificationError, UnexpectedReificationError}
76
import scala.tools.nsc.Global

src/library/scala/StringContext.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
package scala
1010

11-
import language.experimental.macros
12-
1311
/** A class to support string interpolation.
1412
* This class supports string interpolation as outlined in Scala SIP-11.
1513
* It needs to be fully documented once the SIP is accepted.
@@ -99,7 +97,7 @@ case class StringContext(parts: String*) {
9997
* format specifier `%%`.
10098
*/
10199
// The implementation is magically hardwired into `scala.tools.reflect.MacroImplementations.macro_StringInterpolation_f`
102-
def f(args: Any*): String = macro ???
100+
def f(args: Any*): String = ??? // macro
103101
}
104102

105103
object StringContext {

src/library/scala/reflect/base/Base.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package scala.reflect
22
package base
33

4-
import language.experimental.macros
54
import java.io.PrintWriter
65
import scala.annotation.switch
76
import scala.ref.WeakReference
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package scala.reflect
22
package makro
33

4-
import language.experimental.macros
54
import scala.reflect.base.{Universe => BaseUniverse}
65

76
// anchors for materialization macros emitted during tag materialization in Implicits.scala
@@ -10,7 +9,7 @@ import scala.reflect.base.{Universe => BaseUniverse}
109
// todo. once we have implicit macros for tag generation, we can remove these anchors
1110
// [Eugene++] how do I hide this from scaladoc?
1211
package object internal {
13-
private[scala] def materializeClassTag[T](u: BaseUniverse): ClassTag[T] = macro ???
14-
private[scala] def materializeAbsTypeTag[T](u: BaseUniverse): u.AbsTypeTag[T] = macro ???
15-
private[scala] def materializeTypeTag[T](u: BaseUniverse): u.TypeTag[T] = macro ???
12+
private[scala] def materializeClassTag[T](u: BaseUniverse): ClassTag[T] = ??? // macro
13+
private[scala] def materializeAbsTypeTag[T](u: BaseUniverse): u.AbsTypeTag[T] = ??? // macro
14+
private[scala] def materializeTypeTag[T](u: BaseUniverse): u.TypeTag[T] = ??? // macro
1615
}

src/reflect/scala/reflect/api/Universe.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package scala.reflect
22
package api
33

4-
import language.experimental.macros
5-
64
abstract class Universe extends base.Universe
75
with Symbols
86
with Types
@@ -64,5 +62,5 @@ abstract class Universe extends base.Universe
6462
* special measures are taken to ensure that all members accessed in the reifee remain visible
6563
*/
6664
// implementation is magically hardwired to `scala.reflect.reify.Taggers`
67-
def reify[T](expr: T): Expr[T] = macro ???
65+
def reify[T](expr: T): Expr[T] = ??? // macro
6866
}

src/reflect/scala/reflect/makro/Context.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package scala.reflect
22
package makro
33

4-
import language.experimental.macros
5-
64
// todo. introduce context hierarchy
75
// the most lightweight context should just expose the stuff from the SIP
86
// the full context should include all traits from scala.reflect.makro (and probably reside in scala-compiler.jar)

src/reflect/scala/reflect/runtime/package.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package scala.reflect
22

3-
import language.experimental.macros
4-
53
package object runtime {
64

75
// type is api.JavaUniverse because we only want to expose the `scala.reflect.api.*` subset of reflection
86
lazy val universe: api.JavaUniverse = new runtime.JavaUniverse
97

108
// [Eugene++ to Martin] removed `mirrorOfLoader`, because one can use `universe.runtimeMirror` instead
119

12-
def currentMirror: universe.Mirror = macro Macros.currentMirror
10+
// implementation magically hardwired to the `currentMirror` method below
11+
def currentMirror: universe.Mirror = ??? // macro
1312
}
1413

1514
package runtime {

0 commit comments

Comments
 (0)