You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, constructors for union types generate custom classes. For example, this:
type union is int | int[]
Generates this class:
static class union {
final private int tag;
final private Object content;
public union(BigInteger content) {
this.tag = 0;
this.content = content;
}
public union(BigInteger[] content) {
this.tag = 1;
this.content = content;
}
public boolean isBigInteger() {
return this.tag == 0;
}
...
}
This is fine, but note that the constructors overload based on the underlying type of each case. This causes problems if these types are the same. Note, even if the Whiley type differs, the underlying type can still be the same (for example, think about int:8 versus int:16).
Activity