Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 14a672814d
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (19 sloc) 0.497 kb
type A<T> = {
foo(_ : T) -> Number
bar(_ : Number) -> T
}
var a : A<String> := object {
method foo(x : String) -> Number { x.size }
method bar(y : Number) -> String { "{y}" }
}
def b : A<Boolean> = object {
method foo(x : Boolean) -> Number { 1 }
method bar(y : Number) -> Boolean { y < 0 }
}
def c : A<Boolean> = object {
method foo(x : String) -> Number { x.size }
method bar(y : Number) -> String { "{y}" }
}
a := c
print(a.foo("Hello"))
print(b.foo(true))
Jump to Line
Something went wrong with that request. Please try again.