This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo.compat | |
import scala.collection.{GenIterableLike, mutable} | |
import scala.tools.nsc.plugins.{Plugin, PluginComponent} | |
import scala.tools.nsc.{Global, Phase, Settings} | |
object IteratorLinter { | |
def main(args: Array[String]): Unit = { | |
println("go!") | |
val g = new Global(new Settings) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Low { | |
def low = "object Low" | |
def shoot = "missed!" | |
} | |
object High { | |
def high = "object High" | |
def shoot = "bulls eye!" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala-hash v2.11.5 -nobootcp | |
Welcome to Scala version 2.11.5-20150101-184742-3fafbc204f (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import reflect.runtime.universe._ | |
import reflect.runtime.universe._ | |
scala> showRaw(typeOf[Predef.String], printIds = true) | |
res0: String = TypeRef(SingleType(ThisType(scala#8700), scala.Predef#2197), TypeName("String")#3318, List()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --silent --fail https://raw.githubusercontent.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css > /tmp/gh.css && ( | |
echo '<html><head><link rel="stylesheet" href="/tmp/gh.css"/><style>@page { size: A4 landscape; }</style> | |
</head><body><div class="markdown-body">' && \ | |
gh api repos/lightbend/scala-team/issues/188 -t '{{.body}}' | | |
gh api --field text=@- /markdown && \ | |
echo '</div></body></html>' \ | |
) > /tmp/out.html | |
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-gpu --headless --print-to-pdf-no-header --print-to-pdf=/tmp/out.pdf /tmp/out.html | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class M { | |
type AnyIterableOps[+A, Repr] = collection.IterableOps[A, Any, Repr] | |
def richMap[K, V, CC <: collection.MapOps[K, V, AnyIterableOps, CC]] = () | |
def foo(m: scala.collection.immutable.Map[String, String]): AnyIterableOps[(String, String), scala.collection.immutable.Map[String, String]] = m | |
richMap[Int, String, scala.collection.immutable.Map[Int, String]] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object FindCollectionReturningHofs extends App { | |
import scala.tools.nsc._ | |
val global = new Global(new Settings) | |
import global._ | |
import global.settings | |
settings.usejavacp.value = true | |
settings.embeddedDefaults(getClass.getClassLoader) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+++ MANIFEST.MF | |
Manifest-Version: 1.0 | |
Automatic-Module-Name: scala.tools.nsc | |
Bundle-ManifestVersion: 2 | |
Bundle-Name: Scala Compiler | |
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | |
Bundle-SymbolicName: org.scala-lang.scala-compiler | |
Bundle-Version: 2.12.15.v20210703-050957-52d9dbd | |
Class-Path: scala-reflect.jar scala-library.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"jmhVersion" : "1.29", | |
"benchmark" : "org.sample.Jdk11PerfRegressionBenchmark.setPhase", | |
"mode" : "avgt", | |
"threads" : 1, | |
"forks" : 2, | |
"jvm" : "/Users/jz/.jabba/jdk/adopt@1.8.0-272/Contents/Home/bin/java", | |
"jvmArgs" : [ | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after boxUnbox | |
// access flags 0x1000001 | |
public crash()V | |
L0 | |
LINENUMBER 5 L0 | |
L1 | |
LINENUMBER 6 L1 | |
ICONST_0 | |
ISTORE 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L0 | |
LINENUMBER 5 L0 | |
L1 | |
LINENUMBER 6 L1 | |
ACONST_NULL | |
ASTORE 3 | |
L2 | |
ACONST_NULL | |
ASTORE 5 | |
GOTO L3 |