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.nywilken.document-tmpdir
parent
14cf4b40d4
commit
36e43e30ee
@ -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