diff options
| -rw-r--r-- | prog/validation.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/prog/validation.go b/prog/validation.go index ccaa4b990..48a6efade 100644 --- a/prog/validation.go +++ b/prog/validation.go @@ -261,6 +261,10 @@ func (arg *UnionArg) validate(ctx *validCtx, dir Dir) error { if arg.Index < 0 || arg.Index >= len(typ.Fields) { return fmt.Errorf("union arg %v has bad index %v/%v", arg, arg.Index, len(typ.Fields)) } + if arg.transient && !ctx.opts.ignoreTransient { + // The union must have been patched via Call.setDefaultConditions. + return fmt.Errorf("union arg %v is transient (incomplete)", arg) + } opt := typ.Fields[arg.Index] return ctx.validateArg(arg.Option, opt.Type, opt.Dir(dir)) } |
