Skip to content

Instantly share code, notes, and snippets.

kenji yoshida xuwei-k

Block or report user

Report or block xuwei-k

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View A.javap
Classfile /Users/kenji/structural-subtype-javap/A.class
Last modified Aug 12, 2019; size 2453 bytes
MD5 checksum dc2e1948b339005c82b1948b25e9356f
Compiled from "A.scala"
public class A
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1 = Utf8 A
@xuwei-k
xuwei-k / A.javap
Created Aug 11, 2019
Boolean + String
View A.javap
Classfile /Users/kenji/boolean-plus-string/A.class
Last modified Aug 11, 2019; size 1859 bytes
MD5 checksum 45a441997ea15f8a84c80f23f1f0bfe1
Compiled from "A.scala"
public class A
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1 = Utf8 A
View replace-symbol-literal-global-build.sbt
// https://github.com/xuwei-k/replace-symbol-literals
{
val Scalafix = "Scalafix"
val removeCommand = "removeTemporaryScalafix"
def tempPluginDotSbtFile (base: File) =
base / "project" / ("temporaryScalafix.sbt")
Seq(
@xuwei-k
xuwei-k / InjectorOps.scala
Last active Jul 29, 2019
guice TypeLiteral macro in Scala
View InjectorOps.scala
package scala_guice_macro
import com.google.inject.Injector
import scala.reflect.macros.blackbox
import scala.language.experimental.macros
object InjectorOps {
implicit def toInjectorOps(i: Injector): InjectorOps = new InjectorOps(i)
}
View Scala 2.12.9-bin-d386f96 bin compat
method this(java.lang.String)Unit in class scala.throws has a different signature in current version, where it is [N/A] rather than (Ljava/lang/String;)V
filter with: ProblemFilters.exclude[IncompatibleSignatureProblem]("scala.throws.this")
method this()Unit in class scala.Predef#<:< has a different signature in current version, where it is [N/A] rather than ()V
filter with: ProblemFilters.exclude[IncompatibleSignatureProblem]("scala.Predef#<:<.this")
method this()Unit in class scala.Predef#=:= has a different signature in current version, where it is [N/A] rather than ()V
filter with: ProblemFilters.exclude[IncompatibleSignatureProblem]("scala.Predef#=:=.this")
method this(Int)Unit in class scala.Array has a different signature in current version, where it is [N/A] rather than (I)V
filter with: ProblemFilters.exclude[IncompatibleSignatureProblem]("scala.Array.this")
method this()Unit in class scala.UniquenessCache has a different signature in current version, where it is [N/A] rather than ()V
filter with: Pr
View Scala8177.scala
package foo
abstract class A1(x: String) {
def y = x
}
final class B1(x: String) extends A1(x) {
def z = x
}
abstract class A2(protected val x: String) {
@xuwei-k
xuwei-k / big3.scala
Created May 29, 2019 — forked from mpilquist/big3.scala
Example encoding of Functor / Applicative / Monad using dotty 0.15
View big3.scala
/* Example of encoding Functor/Applicative/Monad from cats with Dotty 0.15 features.
* Derived in part from Cats -- see https://github.com/typelevel/cats/blob/master/COPYING for full license & copyright.
*/
package structures
import scala.annotation._
trait Functor[F[_]] {
def (fa: F[A]) map[A, B](f: A => B): F[B]
def (fa: F[A]) as[A, B](b: B): F[B] =
View A.java
import java.util.Arrays;
public class A {
public class B {
public class C1 {
public C1(int a1) {}
}
public class C2 {
public C2(String a1) {}
@xuwei-k
xuwei-k / Main.scala
Last active May 21, 2019
getGenericParameterTypes Scala 2.13.0-RC2
View Main.scala
object A {
trait B {
// include outer param in getGenericParameterTypes
case class C1(a1: Int)
case class C2(a1: String)
case class C3(a1: Array[Int])
// NOT include outer
case class C4(a1: Option[Int])
case class C5(a1: List[Int])
View Main.scala
object A {
trait B {
case class C(a1: Int, a2: Option[Int])
}
object D extends B
}
object Main {
def main(args: Array[String]): Unit = {
You can’t perform that action at this time.