Instantly share code, notes, and snippets.

View ArgsFile.scala
package io.github.retronym
import sbt._
import Keys._
object SbtArgsFilePlugin extends AutoPlugin {
override def trigger = allRequirements
override def requires = sbt.plugins.JvmPlugin
val argsFileContents = taskKey[String]("Contents of file suitable for `scalac @args.txt`")
val argsFile = taskKey[Unit]("Write compiler command line into an args file suitable for `scalac @target/compile.args`")
View RawCompile.scala
package io.github.retronym
import sbt._
import Keys._
object RawCompile extends AutoPlugin {
override def trigger = allRequirements
override def requires = sbt.plugins.JvmPlugin
val compileRaw = taskKey[Unit]("Compile directly, bypassing the incremental compiler")
val cleanClasses = taskKey[Unit]("clean the classes directory")
View pr-7089.diff
This file has been truncated, but you can view the full file.
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
index 8ae5bf8..349c47c 100644
--- a/META-INF/MANIFEST.MF
+++ b/META-INF/MANIFEST.MF
@@ -1,345 +1,5164 @@
Manifest-Version: 1.0
-Automatic-Module-Name: scala.tools.nsc
-Bnd-LastModified: 1534596208290
+Automatic-Module-Name: scala.library
View pr-7089.diff
This file has been truncated, but you can view the full file.
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
index 09c208f..aa1deaa 100644
--- a/META-INF/MANIFEST.MF
+++ b/META-INF/MANIFEST.MF
@@ -1,75 +1,5164 @@
Manifest-Version: 1.0
-Automatic-Module-Name: scala.reflect
-Bnd-LastModified: 1534596081575
+Automatic-Module-Name: scala.library
View gist:0bd4e9f14ce55d0c1b296f1542dd83dc
scala> def impl[T: c.WeakTypeTag](c: Context): c.Tree = { import c.universe._, definitions._; val tpe = c.weakTypeOf[T]; q"$PredefModule.classOf[$tpe]"}
impl: [T](c: scala.reflect.macros.blackbox.Context)(implicit evidence$1: c.WeakTypeTag[T])c.Tree
scala> def clazzOf[T]: Class[_] = macro impl[T]
defined term macro clazzOf: [T]=> Class[_]
scala> classOf[String]
res1: Class[String] = class java.lang.String
View gist:815c16eb7c2538ff2ba9d7508670bbc9
$ cat sandbox/test.scala; scalac -Yshow-trees -Xprint:typer sandbox/test.scala
trait T {
private[this] var foo = 42;
}
class C {
private[this] var foo = 42;
}
[[syntax trees at end of typer]]// Scala source: test.scala
View profile.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View getOrElse-baseline.json
[
{
"jmhVersion" : "1.20",
"benchmark" : "scala.collection.immutable.HashMapBenchmark.getOrElse",
"mode" : "avgt",
"threads" : 1,
"forks" : 1,
"jvm" : "/Users/jz/.jabba/jdk/1.8.172/Contents/Home/jre/bin/java",
"jvmArgs" : [
],
View getOrElse-pr.json
[
{
"jmhVersion" : "1.20",
"benchmark" : "scala.collection.immutable.HashMapBenchmark.getOrElse",
"mode" : "avgt",
"threads" : 1,
"forks" : 1,
"jvm" : "/Users/jz/.jabba/jdk/1.8.172/Contents/Home/jre/bin/java",
"jvmArgs" : [
],
View jstack.log
"pool-10-thread-12" #99 prio=5 os_prio=0 tid=0x00007f58b97a2000 nid=0xe00 runnable [0x00007f5854bf8000]
java.lang.Thread.State: RUNNABLE
at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
at scala.tools.asm.tree.analysis.SourceInterpreter.merge(SourceInterpreter.java:206)
at scala.tools.asm.tree.analysis.SourceInterpreter.merge(SourceInterpreter.java:47)
at scala.tools.asm.tree.analysis.Frame.merge(Frame.java:665)
at scala.tools.asm.tree.analysis.Analyzer.merge(Analyzer.java:529)
at scala.tools.asm.tree.analysis.Analyzer.analyze(Analyzer.java:279)
at scala.tools.nsc.backend.jvm.analysis.BackendUtils$AsmAnalyzer.<init>(BackendUtils.scala:87)
at scala.tools.nsc.backend.jvm.analysis.BackendUtils$ProdConsAnalyzer.<init>(BackendUtils.scala:115)