mirror of https://github.com/hashicorp/packer
Previously duplicate detection for local variables happened during `Initialise`, through a call to `checkForDuplicateLocalDefinition`. This works in a majority of cases, but for commands like `console`, this was not detected as the return diagnostics for `Initialise` are ignored. That check can be done as early as during parsing however, as the names of blocks are not dynamic in the slightest (no interpolation possible), so we move that detection logic into `Parse`, so that the behaviour is coherent between all commands.pull/13039/head
parent
68bc732c47
commit
8c134ba900
@ -0,0 +1,18 @@
|
||||
local "test" {
|
||||
expression = "two"
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
locals {
|
||||
test = local.test
|
||||
}
|
||||
|
||||
variable "test" {
|
||||
type = string
|
||||
default = "home"
|
||||
}
|
||||
source "null" "example" {}
|
||||
|
||||
build {
|
||||
sources = ["source.null.example"]
|
||||
}
|
||||
Loading…
Reference in new issue