Diagnostic and cause
СсылкаMalformed import list
- Семейство
- topaz
- Этап
- parse
- Код
TPZ2011
Причина и условия
Each exported name and each resulting local binding appears at most once in a nonempty selected import list.
Связанное правило · Trigger and repair →Действия
Remove repeated selections. Select at least one identifier and give different exported names distinct local aliases.
Compiler phase: parse.
Compiler explanation: An import selection list is empty, duplicate, or contains an invalid name.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
- an import name is an identifier; keywords cannot be selected Source
- this exported name is already selected in this list Source
- this local name is already bound by this list Source
- a selection list selects at least one exported name Source
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ2011]: this exported name is already selected in this list
The selection list repeats an exported name. A selected import list must be nonempty, and both exported names and local aliases must be unique. Keywords cannot be selected as names.
Trigger and repair
Each exported name and each resulting local binding appears at most once in a nonempty selected import list.
Response
СсылкаRemove repeated selections. Select at least one identifier and give different exported names distinct local aliases.
Reproduction and verification
СсылкаRejected program
Ссылкаimport lib { value, value }
Нет стандартного вывода.export let value = 1
Ожидаемый результат
Ожидаемый результат
Этап отклонения parse. Ненулевой код завершения.
diagnostic-tpz2011 at
example.tpz:1:21
The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.
Corrected program
Ссылкаimport lib { value }
export let value = 1
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.
This program applies the repair described above. The verification status records whether it has been run.