Skip to content

Commit 67d285b

Browse files
authored
fix(docs): incorrect example
The example given to illustrate the behaviour of logical operators is incorrect. `var.foo || var.foo.bar` would also produce an error if the operator was short-circuiting. The example should be with `var.foo && var.foo.bar`, that produces an error in terraform, but wouldn't if `||` could short-circuit
1 parent c049964 commit 67d285b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

website/docs/language/expressions/operators.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ Terraform does not have an operator for the "exclusive OR" operation. If you
104104
know that both operators are boolean values then exclusive OR is equivalent
105105
to the `!=` ("not equal") operator.
106106

107-
The logical operators in Terraform do not short-circuit, meaning `var.foo || var.foo.bar` will produce an error message if `var.foo` is `null` because both `var.foo` and `var.foo.bar` are evaluated.
107+
The logical operators in Terraform do not short-circuit, meaning `var.foo && var.foo.bar` will produce an error message if `var.foo` is `null` because both `var.foo` and `var.foo.bar` are evaluated.

0 commit comments

Comments
 (0)