Created
October 4, 2011 22:57
-
-
Save Sciss/1263101 to your computer and use it in GitHub Desktop.
Demonstrate a runtime error (NoSuchMethodError)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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