Skip to content

Instantly share code, notes, and snippets.

View xeno-by's full-sized avatar

Eugene Burmako xeno-by

View GitHub Profile
15:31 ~$ parse 'enum Day(foo: Int) = x'
[[syntax trees at end of parser]]// Scala source: tmpVbz6xn
package <empty> {
class wrapper extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
enum.Day.update((foo: Int), x)
}
09:32 ~$ prj
09:32 ~/Projects$ cd enum-paradise/
09:32 ~/Projects/enum-paradise (java-enums-via-macro-annotations)$ sbt
[info] Loading project definition from /Users/xeno_by/Projects/enum-paradise/project
[info] Set current project to root (in build file:/Users/xeno_by/Projects/enum-paradise/)
> clean
[success] Total time: 0 s, completed Nov 12, 2013 9:32:25 AM
> compile
[info] Updating {file:/Users/xeno_by/Projects/enum-paradise/}macros...
[info] Updating {file:/Users/xeno_by/Projects/enum-paradise/}root...
15:42 ~/Projects/blackbox (topic/blackbox)$ integrate
Buildfile: /Users/xeno_by/Projects/blackbox/build.xml
desired.jars.uptodate:
boot:
init:
[copy] Copying 2 files to /Users/xeno_by/Projects/blackbox/build/deps/junit
[artifact:dependencies] [WARNING] POM for 'biz.aQute:bndlib:pom:1.43.0:compile' is invalid.
14:51 ~/Projects/210x/sandbox (2.10.x)$ cat Async.scala
package scala {
package object async {
def apply[T](x: => T): T = x
}
}14:51 ~/Projects/210x/sandbox (2.10.x)$ kst
Test.scala:2: error: package scala.async is not a value
async(println("hello"))
^
[[syntax trees at end of typer]] // Test.scala
> test:compile
[warn] Credentials file /Users/xeno_by/.sbt/specs2.credentials does not exist
[info] Compiling 6 Scala sources to /Users/xeno_by/Projects/specs2/target/scala-2.10/classes...
[info] Compiling 16 Scala sources to /Users/xeno_by/Projects/specs2/target/scala-2.10/classes...
[info] Compiling 229 Scala sources to /Users/xeno_by/Projects/specs2/target/scala-2.10/test-classes...
ACHTUNG!!!!!!!!!!
(ScalaCheckMatchersSpec.scala,type arguments [org.scalacheck.Prop,=>] do not conform to method contextAsResult$default$1's type parameter bounds [T,M[_] <: org.specs2.matcher.MatchResult[_]])
java.lang.Exception
at scala.reflect.internal.Types$TypeRef.customToString(Types.scala:2486)
at scala.reflect.internal.Types$TypeRef.safeToString(Types.scala:2519)
19:11 ~/Projects/ScalaVC/sandbox (2.10.2-vc)$ s -uniqid
<synthetic> class VC_FINAL$X#11873 extends X#6968 {
def <init>() = {
super.<init>();
()
};
type VC_T$Y#11875 = VC_FINAL$X#11873.this.VC_TRAIT$X$Y#11874;
<synthetic> class VC_FIX$Y#11879 extends Object#1722 with VC_FINAL$X#11873.this.VC_TRAIT$X$Y#11834 {
def <init>#11881(): VC_FINAL$X#11873.this.VC_FIX$Y#11879 = {
VC_FIX$Y#11879.super.<init>#4689();
[error] /Users/xeno_by/Projects/specs2/src/test/scala/org/specs2/guide/Matchers.scala:571: type mismatch;
[error] found : Any
[error] required: AnyRef
[error] Note: Any is not implicitly converted to AnyRef. You can safely
[error] pattern match `x: AnyRef` or cast `x.asInstanceOf[AnyRef]` to do so.
[error] there were noMoreCallsTo(ignoreStubs(stub1, stub2))
[error] ^
[error] /Users/xeno_by/Projects/specs2/src/test/scala/org/specs2/guide/Matchers.scala:571: type mismatch;
[error] found : Any
[error] required: AnyRef
[info] Compiling 1 Scala source to /Users/xeno_by/Projects/bugBundles/target/scala-2.11.0-M5/classes...
[[syntax trees at end of typer]] // Macros.scala
package barcelona.specification {
import scala.reflect.macros.Macro;
import scala.language.experimental.macros;
abstract trait MBImpl extends AnyRef with scala.reflect.macros.Macro {
def /*MBImpl*/$init$(): Unit = {
()
};
import MBImpl.this.c.universe._;
) else c.Expr[Set[A]] {
def sourceModuleRef(sym: Symbol) = Ident(sym.asInstanceOf[scala.reflect.internal.Symbols#Symbol].sourceModule.asInstanceOf[Symbol])
Apply(Select(reify(Set).tree, newTermName("apply")), children.map(sourceModuleRef(_)))
}
23:08 ~/Projects/210x/sandbox (2.10.x)$ cat Test.scala
class C {
lazy val x = 42
}
23:08 ~/Projects/210x/sandbox (2.10.x)$ scalac Test.scala -Xprint:cleanup
[[syntax trees at end of cleanup]] // Test.scala
package <empty> {
class C extends Object {
@volatile private[this] var bitmap$0: Boolean = false;
private def x$lzycompute(): Int = {