Skip to content

Instantly share code, notes, and snippets.

View xeno-by's full-sized avatar

Eugene Burmako xeno-by

View GitHub Profile
> scripted project/setting-macro
[info] Packaging /Users/xeno_by/Projects/sbt/compile/interface/target/precompiled_2.11.0-M8/precompiled-2_9_2-0.13.2-SNAPSHOT-sources.jar ...
[info] Packaging /Users/xeno_by/Projects/sbt/compile/interface/target/precompiled_2.11.0-M8/precompiled-2_9_3-0.13.2-SNAPSHOT-sources.jar ...
[info] Packaging /Users/xeno_by/Projects/sbt/compile/interface/target/precompiled_2.11.0-M8/precompiled-2_8_2-0.13.2-SNAPSHOT-sources.jar ...
[info] Packaging /Users/xeno_by/Projects/sbt/compile/interface/target/precompiled_2.11.0-M8/compiler-interface-src-0.13.2-SNAPSHOT.jar ...
[info] Done packaging.
[info] Done packaging.
[info] Done packaging.
[info] Done packaging.
[info] :: delivering :: org.scala-sbt#collections;0.13.2-SNAPSHOT :: 0.13.2-SNAPSHOT :: integration :: Sat Feb 15 15:18:38 CET 2014
> scripted project/*
[info] Packaging /Users/xeno_by/Projects/sbt/compile/interface/target/precompiled_2.11.0-M8/precompiled-2_9_2-0.13.2-SNAPSHOT-sources.jar ...
[info] Packaging /Users/xeno_by/Projects/sbt/compile/interface/target/precompiled_2.11.0-M8/precompiled-2_9_3-0.13.2-SNAPSHOT-sources.jar ...
[info] Packaging /Users/xeno_by/Projects/sbt/compile/interface/target/precompiled_2.11.0-M8/precompiled-2_8_2-0.13.2-SNAPSHOT-sources.jar ...
[info] Done packaging.
[info] Done packaging.
[info] Done packaging.
[info] :: delivering :: org.scala-sbt#control;0.13.2-SNAPSHOT :: 0.13.2-SNAPSHOT :: integration :: Sat Feb 15 15:16:14 CET 2014
[info] delivering ivy file to /Users/xeno_by/Projects/sbt/util/control/target/ivy-0.13.2-SNAPSHOT.xml
[info] :: delivering :: org.scala-sbt#sbt-launch;0.13.2-SNAPSHOT :: 0.13.2-SNAPSHOT :: integration :: Sat Feb 15 15:16:14 CET 2014
15:07 ~/Projects/SBT (palladium0)$ sbt-the-rebel-cut
[info] Loading project definition from /Users/xeno_by/Projects/sbt/project
[info] Set current project to root (in build file:/Users/xeno_by/Projects/sbt/)
> set every resolvers += Resolver.sonatypeRepo("snapshots")
[info] Defining */*:resolvers, {.}/*:resolvers
[info] The new values will be used by actions/*:externalResolvers, api/*:externalResolvers and 41 others.
[info] Run `last` for details.
[info] Reapplying settings...
Cyclic reference involving
*/*:resolvers
09:40 ~/Projects/basis (master)$ git rev-parse HEAD
56e5646a92ee015c5ef0d2c00c70bbb645a32878
09:40 ~/Projects/basis (master)$ sbt
[info] Loading project definition from /Users/xeno_by/Projects/basis/project
[info] Set current project to basis (in build file:/Users/xeno_by/Projects/basis/)
> show scalaVersion
[info] text/*:scalaVersion
[info] 2.10.3
[info] form/*:scalaVersion
[info] 2.10.3
import scala.language.experimental.macros
import scala.language.higherKinds
import scala.reflect.macros.blackbox.Context
case class Wrapper[A](arr: Array[A])
object Wrapper {
def literal[A](as: A*): Wrapper[A] = macro Example.wrapperMacro[A, Wrapper]
}
BUILD FAILED
/localhome/jenkins/b/workspace/scala-checkin/build.xml:96: The following error occurred while executing this line:
/localhome/jenkins/b/workspace/scala-checkin/build-ant-macros.xml:8: The following error occurred while executing this line:
/localhome/jenkins/b/workspace/scala-checkin/build.xml:1420: The following error occurred while executing this line:
/localhome/jenkins/b/workspace/scala-checkin/build-ant-macros.xml:488: Test suite finished with 1 case failing:
fail - run/t6200.scala [output differs]% scalac t6200.scala
% /home/jenkins/apps/jdk1.6.0_33-x64/jre/bin/java \
-classpath \
/localhome/jenkins/b/workspace/scala-checkin/test/files/run/t6200-run.obj:/localhome/jenkins/b/workspace/scala-checkin/build/pack/lib/scala-library.jar:/localhome/jenkins/b/workspace/scala-checkin/build/pack/lib/scala-reflect.jar:/localhome/jenkins/b/workspace/scala-checkin/build/pack/lib/scala-compiler.jar:/localhome/jenkins/b/workspace/scala-checkin/build/pack/lib/scalap.jar:/localhome/jenkins/b/workspace/s
19:15 ~/Projects/Master/sandbox (master)$ scala
Welcome to Scala version 2.11.0-20140115-080235-07e823ad97 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_65).
Type in expressions to have them evaluated.
Type :help for more information.
scala> q"class C(x: Int)"
res0: reflect.runtime.universe.ClassDef =
class C extends scala.AnyRef {
<paramaccessor> private[this] val x: Int = _;
def <init>(x: Int) = {
import scala.reflect.macros.WhiteboxContext
import scala.language.experimental.macros
object Macros {
def impl(c: WhiteboxContext) = {
import c.universe._
val result = c.typecheck(q"""
class C[T <: Int] {
type Dummy123 = List[T]
}
import scala.reflect.macros.WhiteboxContext
import scala.language.experimental.macros
object Macros {
def impl[T](c: WhiteboxContext)(implicit T: c.WeakTypeTag[T]) = {
import c.universe._
val allMeths = T.tpe.declarations.collect { case m: MethodSymbol => m }
val goodMeths = allMeths.filter(m => m.isPublic && !m.isConstructor && !m.isSynthetic)
val defDefs = goodMeths.map(m => {
def toMods(sym: Symbol) =
import scala.reflect.macros.{BlackboxContext, WhiteboxContext}
import scala.annotation.compileTimeOnly
import scala.language.experimental.macros
object Macros {
def impl(c: WhiteboxContext)(body: c.Tree) = {
import c.universe._
val Block(stats0, expr) = body
val stats: List[Tree] = stats0 :+ expr
def yyTransform(stats: List[Tree]): List[List[Tree]] = {