Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Commit 130dd61

Browse files
committed
Merge pull request #10 from adriaanm/excise-trace
Remove trace macro. Too unstable.
2 parents 33c09fa + 615924e commit 130dd61

File tree

2 files changed

+3
-49
lines changed

2 files changed

+3
-49
lines changed

build.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ scalaXmlVersion := "1.0.0-RC6"
1212
// so we don't have to wait for sonatype to synch to maven central when deploying a new module
1313
resolvers += Resolver.sonatypeRepo("releases")
1414

15+
// to allow compiling against snapshot versions of Scala
16+
resolvers += Resolver.sonatypeRepo("snapshots")
17+
1518
// dependencies:
1619
libraryDependencies += "org.apache.ant" % "ant" % "1.8.4"
1720

src/main/scala/scala/tools/partest/package.scala

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -184,55 +184,6 @@ package object partest {
184184
vlog(allPropertiesString)
185185
}
186186

187-
import scala.language.experimental.macros
188-
189-
/**
190-
* `trace("".isEmpty)` will return `true` and as a side effect print the following to standard out.
191-
* {{{
192-
* trace> "".isEmpty
193-
* res: Boolean = true
194-
*
195-
* }}}
196-
*
197-
* An alternative to [[scala.tools.partest.ReplTest]] that avoids the inconvenience of embedding
198-
* test code in a string.
199-
*/
200-
def trace[A](a: A) = macro traceImpl[A]
201-
202-
import scala.reflect.macros.BlackboxContext
203-
def traceImpl[A: c.WeakTypeTag](c: BlackboxContext)(a: c.Expr[A]): c.Expr[A] = {
204-
import c.universe._
205-
import definitions._
206-
207-
// xeno.by: reify shouldn't be used explicitly before the final release of 2.10.0,
208-
// because this impairs reflection refactorings
209-
//
210-
// val exprCode = c.literal(show(a.tree))
211-
// val exprType = c.literal(show(a.actualType))
212-
// reify {
213-
// println(s"trace> ${exprCode.splice}\nres: ${exprType.splice} = ${a.splice}\n")
214-
// a.splice
215-
// }
216-
217-
c.Expr(Block(
218-
List(Apply(
219-
Select(Ident(PredefModule), TermName("println")),
220-
List(Apply(
221-
Select(Apply(
222-
Select(Ident(ScalaPackage), TermName("StringContext")),
223-
List(
224-
Literal(Constant("trace> ")),
225-
Literal(Constant("\\nres: ")),
226-
Literal(Constant(" = ")),
227-
Literal(Constant("\\n")))),
228-
TermName("s")),
229-
List(
230-
Literal(Constant(show(a.tree))),
231-
Literal(Constant(show(a.actualType))),
232-
a.tree))))),
233-
a.tree))
234-
}
235-
236187
def isPartestTerse = NestUI.isTerse
237188
def isPartestDebug = NestUI.isDebug
238189
def isPartestVerbose = NestUI.isVerbose

0 commit comments

Comments
 (0)