|
|
|
|
|
by jez
1720 days ago
|
|
In this case UnionBase is not ad hoc: you had to declare a name for it up front. Ad hoc means you can write the union type wherever types can be written. For example, it’s not possible to write this: public (A | B) someMethod();
in Java. |
|
I also want my tools to know what's being returned, as well as my compiler.