aboutsummaryrefslogtreecommitdiffstats
path: root/prog
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2022-01-06 14:48:54 +0100
committerDmitry Vyukov <dvyukov@google.com>2022-01-11 16:30:08 +0100
commit993f2038a54bae8d42ae20fc24ecee845b8b9c5d (patch)
tree28e12abdb1a097e38121937b96b08b714fc51aa5 /prog
parente32a30eb7d4ae377ae60eb4a5149e6fdf82b212a (diff)
prog: error if program variable refers to non-resource
Error if program variable refers to non-resource in strict parsing mode. Such errors are hard to diagnose otherwise since the variable is silently discarded.
Diffstat (limited to 'prog')
-rw-r--r--prog/encoding.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/prog/encoding.go b/prog/encoding.go
index 98dee8a8e..92b7f2be3 100644
--- a/prog/encoding.go
+++ b/prog/encoding.go
@@ -411,6 +411,8 @@ func (p *parser) parseArg(typ Type, dir Dir) (Arg, error) {
if r != "" {
if res, ok := arg.(*ResultArg); ok {
p.vars[r] = res
+ } else {
+ p.strictFailf("variable %v doesn't refers to a resource", r)
}
}
return arg, nil