Diagnostic and cause
링크Invalid assignment target
- 계열
- topaz
- 단계
- parse
- 코드
TPZ2003
원인과 조건
An assignment target must be an identifier, member access, or index access.
관련 규칙 · Trigger and repair →대응
Assign to a mutable binding or to a supported member or index rooted in one. Mutability and type compatibility are checked after this syntax requirement.
Compiler phase: parse.
Compiler explanation: The left side of an assignment is not an assignable place.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
- assignment target must be an identifier, member access, or index access Source
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ2003]: assignment target must be an identifier, member access, or index access
The left side of an assignment is a computed expression. The parser accepts an identifier, member access, or index access in that position.
Trigger and repair
An assignment target must be an identifier, member access, or index access.
Response
링크Assign to a mutable binding or to a supported member or index rooted in one. Mutability and type compatibility are checked after this syntax requirement.
Reproduction and verification
링크Rejected program
링크(1 + 2) = 3
표준 출력 없음.기대 결과
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 mut value = 1value = 3
기대 결과
기대 결과
검사가 프로그램을 받아들입니다. 종료 코드 0.
This program applies the repair described above. The verification status records whether it has been run.