[spec2] s/union discards custom generator of a unqualified key spec

Description

s/union will discard a custom generator attached to a spec of an unqualified key.

The example below fails to generate anything

The reason for this here: https://github.com/clojure/spec-alpha2/blob/master/src/main/clojure/clojure/alpha/spec/impl.clj#L499s/union converts a spec obj back into a symbolic form which does not contain the generator.

I would submit a patch, but I'm not sure what would be the right way to fix this. If a custom generator should be part of the symbolic representation of a spec then the create-spec method for with-gen should reflect that. Otherwise, this conversion to symbolic form in s/union should somehow be avoided. Advice is welcome.

Environment

None

Assignee

Unassigned

Reporter

Ognen Ivanovski

Priority

Major