Skip to content

Instantly share code, notes, and snippets.

@kmizu
Forked from xuwei-k/ClassFormatErrorBug.scala
Created March 30, 2016 01:09
Show Gist options
  • Save kmizu/0907857f82b39755bb0d6707c1baba0b to your computer and use it in GitHub Desktop.
Save kmizu/0907857f82b39755bb0d6707c1baba0b to your computer and use it in GitHub Desktop.
scalaVersion := "2.11.8"
package com.example
case class Foo[M[_], A](step: M[Foo.Step[A, Foo[M, A]]])
object Foo {
class Step[A, S]
object Done {
def unapply[A, S](a: Step[A, S]): Boolean = true
}
}
object ClassFormatErrorBug {
implicit class AnyOps[A](actual: A) {
def mustMatch(f: PartialFunction[A, Boolean]): Unit = {
}
}
type Id[+A] = A
def main(args: Array[String]): Unit = {
val s = new Foo[Id, String](new Foo.Step[String, Foo[Id, String]])
s.step mustMatch {
case Foo.Done() => true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment