Created
February 10, 2012 23:44
-
-
Save non/1794165 to your computer and use it in GitHub Desktop.
This file contains 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
import scala.{specialized => spec} | |
class Foo[@spec(Int) A](val a:A) { | |
def sink(x:A) = () | |
def bar[@spec(Int) B](b:B):Int = { | |
sink(a) | |
99 | |
} | |
} | |
object Main { | |
def z1(a:Int, b:Int) = new Foo(a).bar(b) | |
def z2(a:Int, b:String) = new Foo(a).bar(b) | |
def z3(a:String, b:Int) = new Foo(a).bar(b) | |
def z4(a:String, b:String) = new Foo(a).bar(b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment