Skip to content

Instantly share code, notes, and snippets.

@MasseGuillaume
Created May 18, 2016 15:54
Show Gist options
  • Save MasseGuillaume/bd1fced5651b6c545363382283c9735e to your computer and use it in GitHub Desktop.
Save MasseGuillaume/bd1fced5651b6c545363382283c9735e to your computer and use it in GitHub Desktop.
import com.scalakata._
trait B
@instrument class Playground extends B {
1
}
exception: scala.MatchError: List(class Playground extends B {
def <init>() = {
super.<init>();
()
};
1
}) (of class scala.collection.immutable.$colon$colon)
^illegal inheritance;
self-type Playground does not conform to com.scalakata.Instrumented's selftype com.scalakata.Instrumented
^self constructor arguments cannot reference unconstructed `this`
^type mismatch;
found : scala.collection.mutable.Map[com.scalakata.RangePosition,com.scalakata.Render]
required: scala.collection.mutable.Map
^not found: value fresh$macro$5
c.Expr[Any]{
try {
annottees.map(_.tree).toList match {
case q"class $name { ..$body }" :: Nil ⇒ {
// implementation...
}
}
} catch {
case scala.util.control.NonFatal(e) ⇒ {
c.error(c.enclosingPosition, s"exception: ${e.toString}")
q"..$annottees"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment