mirror of
https://github.com/Z3Prover/z3
synced 2026-07-15 11:35:42 +00:00
Fix Java API ClassCastException when getting EnumSort of constant
- Add EnumSort(Context ctx, long obj) constructor to allow creating EnumSort from an existing native sort object - Modify Sort.create() to detect enum sorts (all constructors have arity 0) and return EnumSort instead of DatatypeSort, mirroring Z3's own is_enum_sort implementation Closes #7335
This commit is contained in:
parent
431f0223f0
commit
4e48303776
2 changed files with 16 additions and 0 deletions
|
|
@ -92,6 +92,11 @@ public class EnumSort<R> extends Sort
|
|||
return new FuncDecl<>(getContext(), Native.getDatatypeSortRecognizer(getContext().nCtx(), getNativeObject(), inx));
|
||||
}
|
||||
|
||||
EnumSort(Context ctx, long obj)
|
||||
{
|
||||
super(ctx, obj);
|
||||
}
|
||||
|
||||
EnumSort(Context ctx, Symbol name, Symbol[] enumNames)
|
||||
{
|
||||
super(ctx, Native.mkEnumerationSort(ctx.nCtx(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue