Skip to content

Instantly share code, notes, and snippets.

View retronym's full-sized avatar

Jason Zaugg retronym

View GitHub Profile
scala> val f = new java.io.File("/tmp/test.zip"); val zos = new java.util.zip.ZipOutputStream(new java.io.FileOutputStream(f)); zos.putNextEntry(new java.util.zip.ZipEntry("\u012f" + "/")); zos.closeEntry(); zos.close()
f: java.io.File = /tmp/test.zip
zos: java.util.zip.ZipOutputStream = java.util.zip.ZipOutputStream@6c4e11d0
scala> val zf = new java.util.zip.ZipFile(f); try zf.getEntry("\u012f") finally zf.close()
zf: java.util.zip.ZipFile = java.util.zip.ZipFile@14b0b7f9
res16: java.util.zip.ZipEntry = į/
scala> val zf = new java.util.zip.ZipFile(f); try zf.getEntry("\u012f" + "/") finally zf.close()
zf: java.util.zip.ZipFile = java.util.zip.ZipFile@4700064f
git -P log -1 && git clean -fdx && java -version && sbt 'packagePlugin' 'runDebuggerTests'
commit 468fc60a3f67f2db22c94c4ad1fcb4b94f6617a5 (HEAD -> topic/clean-slate, retronym/idea201.x, origin/idea201.x, idea201.x)
Author: Justin Kaeser <justin.kaeser@jetbrains.com>
Date: Tue Apr 7 23:01:48 2020 +0200
Revert "Not use blocking call in the attachSbtProjectAndRefresh #SCL-17353"
this fix caused the project view not to show the full project tree until the full import completed
when BSP import dialog is disabled, the hanging that this change addresses does not happen, so we can revert it
import scala.concurrent._, duration.Duration, ExecutionContext.Implicits.global
import scala.async.Async.{async, await}
object Test {
def test: Future[Int] = async { await(f(1)) + await(f(2)) }
def f(x: Int): Future[Int] = Future.successful(x)
}
import scala.concurrent._, duration.Duration, ExecutionContext.Implicits.global
import scala.async.Async.{async, await}
object Test {
def test: Future[Int] = async {
val x: Option[Either[Object, (String, String)]] = Some(Right(("a", "b")))
x match {
case Some(Left(_)) => 1
case Some(Right(("a", "c"))) => 2
case Some(Right(("a", "e"))) => 3
case Some(Right(("a", x))) if "ab".isEmpty => 4
diff --git a/src/compiler/scala/tools/nsc/transform/async/ExprBuilder.scala b/src/compiler/scala/tools/nsc/transform/async/ExprBuilder.scala
index 4975a4e04f..389ca1637a 100644
--- a/src/compiler/scala/tools/nsc/transform/async/ExprBuilder.scala
+++ b/src/compiler/scala/tools/nsc/transform/async/ExprBuilder.scala
@@ -68,6 +68,17 @@ trait ExprBuilder extends TransformUtils {
s"AsyncState #$state, next = $nextState"
}
+ final class OpaqueAsyncState(var stats: List[Tree], val state: Int, val nextStates: Array[Int], symLookup: SymLookup)
+ extends AsyncState {
jardiff $(scala-classpath $(scala-ref-version 23f0ead6df645b452d25e90bc1ab1516a8098eb5)) $(scala-classpath $(scala-pr-version 8525))
WARN: unable to invoke scalap on: /scala/concurrent/duration/package.class: Unexpected failure
WARN: unable to invoke scalap on: /scala/concurrent/duration/package.class: Unexpected failure
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
index 11033f9..f086f56 100644
--- a/META-INF/MANIFEST.MF
+++ b/META-INF/MANIFEST.MF
@@ -1,310 +1,72 @@
Manifest-Version: 1.0
-Automatic-Module-Name: scala.tools.nsc
ls -lart '/tmp/$line648'
total 1448
-rw-r--r-- 1 jz wheel 399 Nov 28 16:53 $read$.class
-rw-r--r-- 1 jz wheel 4892 Nov 28 16:53 $read.class
-rw-r--r-- 1 jz wheel 506 Nov 28 16:53 $read$$iw$.class
-rw-r--r-- 1 jz wheel 551 Nov 28 16:53 $read$$iw$$iw$.class
-rw-r--r-- 1 jz wheel 600 Nov 28 16:53 $read$$iw$$iw$$iw$.class
-rw-r--r-- 1 jz wheel 653 Nov 28 16:53 $read$$iw$$iw$$iw$$iw$.class
-rw-r--r-- 1 jz wheel 710 Nov 28 16:53 $read$$iw$$iw$$iw$$iw$$iw$.class
-rw-r--r-- 1 jz wheel 771 Nov 28 16:53 $read$$iw$$iw$$iw$$iw$$iw$$iw$.class
for i in {1..1000}; do printf 'object bar { val foo = '$i'}; \nimport bar.foo\n foo\n val foo = ""\n foo\n'; done | scala
Welcome to Scala 2.13.1 (OpenJDK 64-Bit Server VM, Java 1.8.0_212).
Type in expressions for evaluation. Or try :help.
scala> object bar { val foo = 1};
defined object bar
scala> import bar.foo
import bar.foo
@retronym
retronym / repl-encoding.out
Created November 28, 2019 04:00
REPL encoding
➜ scala-public-pickle git:(topic/public-pickle) printf 'object foo { def bar = 42}\nimport foo._\nbar\n val bar = 43\nbar\n' | scala -Xprint:parser -Yrepl-class-based
Welcome to Scala 2.13.1 (OpenJDK 64-Bit Server VM, Java 1.8.0_212).
Type in expressions for evaluation. Or try :help.
scala> object foo { def bar = 42}
[[syntax trees at end of parser]] // <console>
package $line3 {
sealed class $read extends _root_.scala.Serializable {
def <init>() = {
super.<init>();
after boxUnbox
// access flags 0x1000001
public scala$collection$mutable$PriorityQueue$$heapify(I)V
// parameter final from
L0
LINENUMBER 148 L0
L1
LINENUMBER 151 L1
ALOAD 0