Skip to content

Instantly share code, notes, and snippets.

View retronym's full-sized avatar

Jason Zaugg retronym

View GitHub Profile
@retronym
retronym / append.log
Last active August 29, 2015 14:01
alternative to `set every` in SBT
% sbt 'appendScalacOptions -Ydebug' "show scalacOptions" "show test:scalacOptions"
[info] Loading global plugins from /Users/jason/.sbt/0.13/plugins
[info] Loading project definition from /Users/jason/code/scratch3/project
[info] Set current project to scratch3 (in build file:/Users/jason/code/scratch3/)
[info] Reapplying settings...
[info] Set current project to scratch3 (in build file:/Users/jason/code/scratch3/)
[info] b/*:scalacOptions
[info] List(-Ydebug)
[info] a/*:scalacOptions
[info] List(-Xcheckinit, -Ydebug)
META-INF/
META-INF/MANIFEST.MF
META-INF/services/javax.script.ScriptEngineFactory
compiler.properties
rootdoc.txt
scala/
scala/reflect/
scala/reflect/macros/
scala/reflect/macros/compiler/
scala/reflect/macros/compiler/DefaultMacroCompiler$$anonfun$1.class
This file has been truncated, but you can view the full file.
--- from_file
+++ (clipboard)
@@ -1,4 +1,4 @@
-Started by build flow pr-scala#7419
+Started by build flow pr-scala#7421
Building remotely on lampscalatst3-b (checkin auxjvm nightly) in workspace /localhome/jenkins/b/workspace/pr-scala-integrate-ide
> git rev-parse --is-inside-work-tree
Fetching changes from the remote Git repository
@@ -7,25 +7,39 @@
> git --version
--- sandbox/good.log 2014-05-21 07:08:00.000000000 +0200
+++ sandbox/bad.log 2014-05-21 07:08:10.000000000 +0200
@@ -1,693 +1,775 @@
[running phase parser on t8607.scala]
[running phase namer on t8607.scala]
[running phase packageobjects on t8607.scala]
[running phase typer on t8607.scala]
[running phase patmat on t8607.scala]
[running phase superaccessors on t8607.scala]
[running phase extmethods on t8607.scala]
@retronym
retronym / shell.sh
Last active August 29, 2015 14:01
950 scalac-hash v2.11.0-RC1~68 -Ytyper-debug -Xprint:typer -classpath /Users/jason/.ivy2/cache/org.scalaz/scalaz-core_2.11/jars/scalaz-core_2.11-7.0.6.jar sandbox/unapply.scala 2>&1 | tee sandbox/68.log 951 scalac-hash v2.11.0-RC1~66 -Ytyper-debug -Xprint:typer -classpath /Users/jason/.ivy2/cache/org.scalaz/scalaz-core_2.11/jars/scalaz-core_2.1…
% for i in 67 66; do scalac-hash v2.11.0-RC1~$i -Ytyper-debug -Xprint:typer -classpath /Users/jason/.ivy2/cache/org.scalaz/scalaz-core_2.11/jars/scalaz-core_2.11-7.0.6.jar sandbox/unapply.scala 2>&1 | tee sandbox/68.log 951 scalac-hash v2.11.0-RC1~66 -Ytyper-debug -Xprint:typer -classpath /Users/jason/.ivy2/cache/org.scalaz/scalaz-core_2.11/jars/scalaz-core_2.11-7.0.6.jar sandbox/unapply.scala 2>&1 | tee sandbox/$i.log
% diff -u sandbox/{67,66}.log | subl
@retronym
retronym / 0.sh
Last active August 29, 2015 14:01
% qbin/scalac -Ydebug -Ylog:icode -Ylinearizer:rpo sandbox/test.scala 2>&1 | tee sandbox/bad.txt
% qbin/scalac -Ydebug -Ylog:icode -Ydisable-unreachable-prevention -Ylinearizer:rpo sandbox/test.scala 2>&1 | tee sandbox/good.txt
% diff -U1000 sandbox/{good,bad}.txt | gist
======= Position error
Overlapping trees (544,539)
== Ancestor tree [560] of type Template at [22:163]t8596.scala
[L 1 ] #560 [22:163] Template // {
== First overlapping tree [544] of type Select at [131:159]t8596.scala
[L 5 ] #544 [131:159] Select // new Container().typeParamAndD
@retronym
retronym / qq.scala
Created June 20, 2014 18:12
Block vs q"{ ... }"
scala> q"{0; val x = 0}"
res6: $r.intp.global.Tree =
{
0;
val x = 0;
()
}
scala> Block(q"0" :: Nil, q"val x = 0")
res7: $r.intp.global.Block =
/code cd war
/code/war
/code/war subl build.sbt
/code/war mkdir project
/code/war subl project/build.properties
/code/war subl project/plugins.sbt
/code/war tail build.sbt project/build.properties project/plugins.sbt
==> build.sbt <==
scalaVersion := "2.10.3"
@retronym
retronym / bounds.scala
Created July 4, 2014 09:37
abstract types to lower bounds
scala> trait T[A >: Null <: String] { type M = List[A] }
defined trait T
scala> val listA = symbolOf[T[_]].info.member(TypeName("M")).info
listA: $r.intp.global.Type = List[A]
scala> listA.map(tp => if (tp.typeSymbol.isAbstract) tp.bounds.lo else tp)
res12: $r.intp.global.Type = List[Null]