From 993f2038a54bae8d42ae20fc24ecee845b8b9c5d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 6 Jan 2022 14:48:54 +0100 Subject: 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. --- prog/encoding.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'prog/encoding.go') 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 -- cgit mrf-deployment