aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--prog/rand.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/prog/rand.go b/prog/rand.go
index 5489ca10d..a47e64b79 100644
--- a/prog/rand.go
+++ b/prog/rand.go
@@ -491,6 +491,10 @@ func (r *randGen) generateArgImpl(s *state, typ Type, ignoreSpecial bool) (arg A
}
if typ.Optional() && r.oneOf(5) {
+ if res, ok := typ.(*ResourceType); ok {
+ v := res.Desc.Values[r.Intn(len(res.Desc.Values))]
+ return MakeResultArg(typ, nil, v), nil
+ }
return r.target.defaultArg(typ), nil
}