WithPath should only modify the copy

This commit is contained in:
James Bardin 2020-09-30 10:45:55 -04:00
parent c258e8efbb
commit bdef106a8b
1 changed files with 1 additions and 1 deletions

View File

@ -79,8 +79,8 @@ type BuiltinEvalContext struct {
var _ EvalContext = (*BuiltinEvalContext)(nil)
func (ctx *BuiltinEvalContext) WithPath(path addrs.ModuleInstance) EvalContext {
ctx.pathSet = true
newCtx := *ctx
newCtx.pathSet = true
newCtx.PathValue = path
return &newCtx
}