Hi,

I have an interface with a function returning one of several possible value 
types in a union:

interface Interface {
    getResult @0 () -> (result :Result);
    
    struct Result {
        union {
            string @0 :Text;
            int @1 :Int32;
        }
    }
}

I would now like to add another function returning an enum indicating the 
type that would be returned by the first function:

interface Interface {
    # ...
    
    getResultType @1 () -> (type :ResultType);
    
    enum ResultType {
        string @0;
        int @1;
    }
}

Is there some way of achieving this without having to duplicate the Result 
union in the ResultType enum? Ideally, getResultType would simply return 
the tag type of the Result union.

Thanks!
Johannes

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to