#1675 Union type?

Xan Sat 22 Oct 2011

Hi,

I saw an Introduction to Ceylon and I see this example of union type:

//union type void print(String|Named printable) {

String string;
switch (printable)
case (is String) {
    string = printable;
}
case (is Named) {
    string = printable.name;
}
writeLine(string);

}

I'm just curious if there is an equivalent in Fantom.

Thanks in advance, Xan.

helium Sat 22 Oct 2011

No, there isn't. You have to use Obj instead.

Xan Sat 22 Oct 2011

Thanks

Login or Signup to reply.