Diagnostic and cause
링크Duplicate import
- 계열
- topaz
- 단계
- resolve
- 코드
TPZ3017
원인과 조건
Importing the same logical module twice from one module produces TPZ3017, including imports that select different names.
관련 규칙 · Trigger and repair →대응
Combine the selected names into one import declaration or use one namespace import.
Compiler phase: resolve.
Compiler explanation: The same logical module is imported more than once in one module.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
⟨value⟩is already imported by this module; a logical module may appear in at most one import item Source
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ3017]:
libis already imported by this module; a logical module may appear in at most one import item
The module already has an import for the same logical dependency. Different selection lists do not create distinct dependencies.
Trigger and repair
Importing the same logical module twice from one module produces TPZ3017, including imports that select different names.
Response
링크Combine the selected names into one import declaration or use one namespace import.
Reproduction and verification
링크Rejected program
링크import lib { first }import lib { second }
표준 출력 없음.export let first = 1export let second = 2
기대 결과
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 { first, second }
export let first = 1export let second = 2
기대 결과
기대 결과
검사가 프로그램을 받아들입니다. 종료 코드 0.
This program applies the repair described above. The verification status records whether it has been run.