Skip to content

Instantly share code, notes, and snippets.

@Sciss
Created October 4, 2011 22:57
Show Gist options
  • Save Sciss/1263101 to your computer and use it in GitHub Desktop.
Save Sciss/1263101 to your computer and use it in GitHub Desktop.
Demonstrate a runtime error (NoSuchMethodError)
trait Fut[ A ] { def set( i: A ) : Unit }
object Fut {
def empty[ A ]() : Fut[ A ] = new Fut[ A ] {
final case class Set( value : A )
def receive( x : AnyRef ) { x match {
case Set( value ) => println( "Got " + value )
}}
def set( value : A ) { receive( Set( value ))}
}
}
val g = Fut.empty[ Int ]()
g.set( 33 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment