Diagnostic and cause
링크Invalid exported let pattern
- 계열
- topaz
- 단계
- parse
- 코드
TPZ2007
원인과 조건
An exported let uses the ordinary immutable let pattern rules and publishes every bound name. A pattern with no bound name is rejected with TPZ2007 during parsing.
관련 규칙 · Trigger and repair →대응
Remove export when no name is published, or bind the names that callers need with an ordinary immutable let pattern.
The 6.0 contract rejects exported patterns without a bound name. The following message and observation describe the historical 5.21.3 single-identifier restriction. They do not prohibit destructuring in Topaz 6.0.
Compiler phase: parse.
Compiler explanation: An exported let declaration uses a pattern other than one identifier.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
- an exported
letbinds exactly one identifier; destructure privately, then export the identifier Source
An exported let pattern binds no name. Use export for one or more ordinary immutable pattern bindings.
Trigger and repair
An exported let uses the ordinary immutable let pattern rules and publishes every bound name. A pattern with no bound name is rejected with TPZ2007 during parsing.
Response
링크Remove export when no name is published, or bind the names that callers need with an ordinary immutable let pattern.
Reproduction and verification
링크Rejected program
링크export let _ = 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
링크let _ = 1
기대 결과
기대 결과
검사가 프로그램을 받아들입니다. 종료 코드 0.
This program applies the repair described above. The verification status records whether it has been run.