Skip to content

Instantly share code, notes, and snippets.

View lrytz's full-sized avatar
🦉

Lukas Rytz lrytz

🦉
View GitHub Profile
{
"os": [
"linux"
],
"env": {
"global": [
{
"ADOPTOPENJDK": "8"
},
{
@lrytz
lrytz / squashpr
Last active September 25, 2019 07:11
#!/bin/bash
set -e
[[ $# == 1 ]] || {
echo "usage: $0 <pr-number>"
exit 1
}
pr=$1
scala> import annotation.unchecked.uncheckedStable
import annotation.unchecked.uncheckedStable
scala> class A { class B }
defined class A
scala> @uncheckedStable var a = new A
a: A = A@6885f3f7
scala> println(new a.B)
package scala.compat.java8;
public interface StreamShapeLowPriority {
protected abstract class BaseStreamShape<T extends java.lang.Object, S extends java.util.stream.BaseStream<?, S>, St extends scala.compat.java8.collectionImpl.Stepper<?>> implements scala.compat.java8.StreamShape<T, S> {
// not preceding
// TypeTree().setOriginal(TypeBoundsTree(TypeTree(), TypeTree()))
// TypeTree().setOriginal(TypeBoundsTree(TypeTree(), TypeTree().setOriginal(ExistentialTypeTree(AppliedTypeTree(Select(Select(Select(Ident(java), java.util), java.util.stream), java.util.stream.BaseStream), List(TypeTree().setOriginal(Ident(TypeName("_$9"))), TypeTree().setOriginal(Ident(TypeName("S"))))), List(TypeDef(Modifiers(DEFERRED | SYNTHETIC), TypeName("_$9"), List(), TypeBoundsTree(EmptyTree, EmptyTree)))))))
// TypeTree().setOriginal(TypeBoundsTree(TypeTree(), TypeTree().setOriginal(ExistentialTypeTree(AppliedTypeTree(Select(Select(Select(Select(Ident(scala), scala.compat), scala.compat.java8), scala.compat.java8.
#!/usr/bin/env bash
die () {
echo "$@"
exit 1
}
repo_dir=$(git rev-parse --show-toplevel) || die "Run this script in a Scala git checkout"
current () {
@lrytz
lrytz / usability-summer.md
Last active July 11, 2019 09:18
Summer of Usability

Summer of Usability

Dear Community

We from the Scala team at Lightbend have decided to take some time this summer to work on usability improvements that are always falling through the cracks while we're busy working on the hard features of the next Scala release. Here is a summary of our project proposals.

REPL usability improvements

@som-snytt already implemented the JLine 3 upgrade (scala/scala#8036) which gives multi-line history and editing. We are planning to add further improvements (many of them pioneered by Ammonite and/or the Dotty REPL) on top of this, for example syntax highlighting and import library dependencies.

scala> println(typeOf[Option[String]].membersBasedOnFlags(0, scala.reflect.internal.Flags.METHOD).toList.sortBy(_.name).mkString("\n"))
method $asInstanceOf
method !=
method :\
method /:
method ==
method ##
method $init$
method $isInstanceOf
constructor Option
@lrytz
lrytz / 0-overview.md
Last active May 5, 2019 18:33
-prof perfasm output for NoCHAPreventsOptimization
// class version 52.0 (52)
// access flags 0x601
// signature Ljava/lang/Object;Lscala/Function0<Ljava/lang/Object;>;Ljava/io/Serializable;
// declaration: scala/runtime/java8/JFunction0$mcV$sp extends scala.Function0<java.lang.Object>, java.io.Serializable
public abstract interface scala/runtime/java8/JFunction0$mcV$sp implements scala/Function0 java/io/Serializable {
// compiled from: JFunction0$mcV$sp.scala
@Ljava/lang/FunctionalInterface;()
import annotation.unchecked.uncheckedVariance
trait Bldr[-A, +To] { self =>
def result(): To
}
trait ItFact[+CC[_]] {
def from[A](source: It[A]): CC[A]
def newBuilder[A]: Bldr[A, CC[A]]
}