Open GoogleCodeExporter opened 8 years ago
type cast via
@Typed eq(String x, y) { x==y}
You could also use overload mechanism :
n = 42
@Typed eq(String x, GString y) { println "String / GString"; x==y}
@Typed eq(GString x, String y) { println "GString / String"; x==y}
@Typed eq(String x, String y) { println "String / String"; x==y}
assert '42' == "$n"
assert "$n" == '42'
assert eq('42', "$n") // -> OK
assert eq("$n", '42') // -> OK
assert eq("$n".toString(), '42') // -> OK
println ("finished")
Imho it's useless to annotate @typed without using types.
Original comment by gabriel....@googlemail.com
on 18 Oct 2011 at 7:47
Original issue reported on code.google.com by
a...@schmideg.net
on 13 Oct 2011 at 4:16