Diagnostic and cause
링크Namespace used as value
- 계열
- topaz
- 단계
- resolve
- 코드
TPZ3012
원인과 조건
Reading an imported namespace as a standalone value produces TPZ3012. Select an exported member instead.
관련 규칙 · Trigger and repair →대응
Select an exported member, such as ns.member, before storing or passing the value.
Compiler phase: resolve.
Compiler explanation: A module namespace binding appears where a runtime value is required.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
⟨value⟩is a namespace, not a value; it may appear only as⟨value⟩.Sourcemember
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ3012]:
nsis a namespace, not a value; it may appear only asns.member
The expression names the module namespace itself. A namespace provides member access and is not a runtime value.
Trigger and repair
Reading an imported namespace as a standalone value produces TPZ3012. Select an exported member instead.
Response
링크Select an exported member, such as ns.member, before storing or passing the value.
Reproduction and verification
링크Rejected program
링크import lib as nslet value = ns
표준 출력 없음.export let member = 1
기대 결과
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 as nslet value = ns.member
export let member = 1
기대 결과
기대 결과
검사가 프로그램을 받아들입니다. 종료 코드 0.
This program applies the repair described above. The verification status records whether it has been run.