File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -129,10 +129,9 @@ or contains a _variable_ that does not directly or indirectly reference a _decla
129
129
130
130
### Duplicate Declaration
131
131
132
- A **_<dfn>Duplicate Declaration</dfn>_** error occurs when a _variable_ appears in two _declarations_.
133
- This includes when an _input-declaration_ binds a _variable_ that appears in a previous _declaration_,
134
- when a _local-declaration_ binds a _variable_ that appears in a previous _declaration_,
135
- or when a _local-declaration_ refers to its bound _variable_ in its _expression_.
132
+ A **_<dfn>Duplicate Declaration</dfn>_** error occurs when a _variable_ is declared more than once.
133
+ Note that an input _variable_ is implicitly declared when it is first used,
134
+ so explicitly declaring it after such use is also an error.
136
135
137
136
> Examples of invalid messages resulting in a _Duplicate Declaration_ error:
138
137
>
@@ -149,6 +148,10 @@ or when a _local-declaration_ refers to its bound _variable_ in its _expression_
149
148
> .local $var = {$ext :number maxFractionDigits=0}
150
149
> {{Redeclaration of an input variable}}
151
150
>
151
+ > .input {$var :number minFractionDigits=$var2}
152
+ > .input {$var2 :number}
153
+ > {{Redeclaration of the implicit input variable $var2}}
154
+ >
152
155
> .local $var = {$ext :someFunction}
153
156
> .local $var = {$error}
154
157
> .local $var2 = {$var2 :error}
Original file line number Diff line number Diff line change @@ -175,14 +175,14 @@ local-declaration = local s variable [s] "=" [s] expression
175
175
_ Variables_ , once declared, MUST NOT be redeclared.
176
176
A _ message_ that does any of the following is not _ valid_ and will produce a
177
177
_ Duplicate Declaration_ error during processing:
178
- - An _ input-declaration _ MUST NOT bind a _ variable_ that appears as a _ variable _ in a previous
179
- _ declaration_ .
180
- - A _ local -declaration_ MUST NOT bind a _ variable_ that appears as a _ variable _ in a previous
181
- _ declaration _ .
178
+ - A _ declaration _ MUST NOT bind a _ variable_
179
+ that appears as a _ variable _ anywhere within a previous _ declaration_ .
180
+ - An _ input -declaration_ MUST NOT bind a _ variable_
181
+ that appears anywhere within the _ annotation _ of its _ variable-expression _ .
182
182
- A _ local-declaration_ MUST NOT bind a _ variable_ that appears in its _ expression_ .
183
183
184
184
A _ local-declaration_ MAY overwrite an external input value as long as the
185
- external input value does not appear in a _ declaration_ .
185
+ external input value does not appear in a previous _ declaration_ .
186
186
187
187
> [ !Note]
188
188
> These restrictions only apply to _ declarations_ .
You can’t perform that action at this time.
0 commit comments