This seems like a gratuitous one-liner that's hard to parse.

    } with { if (exists(...) && exists(...) {
        error ("At most one of...");
    }};

would be easier on the reader I think.