diff --git a/compiler/semantic/scope.go b/compiler/semantic/scope.go index ceab9f038c..1f6e873d94 100644 --- a/compiler/semantic/scope.go +++ b/compiler/semantic/scope.go @@ -58,7 +58,7 @@ func (s *Scope) DefineConst(zctx *super.Context, name *ast.ID, def dag.Expr) err } if val.IsError() { if val.IsMissing() { - return fmt.Errorf("const %q: cannot have variable dependency", name) + return fmt.Errorf("const %q: cannot have variable dependency", name.Name) } else { return fmt.Errorf("const %q: %q", name, string(val.Bytes())) } diff --git a/compiler/ztests/const-err.yaml b/compiler/ztests/const-err.yaml index 962a9f123c..141bb26151 100644 --- a/compiler/ztests/const-err.yaml +++ b/compiler/ztests/const-err.yaml @@ -4,9 +4,7 @@ input: | {a:1} {a:2} -output: "" - error: | - const &{"ID" "t" {'\x06' '\x06'}}: cannot have variable dependency at line 1, column 1: + const "t": cannot have variable dependency at line 1, column 1: const t=a put x:=t ~~~~~~~~~