Diagnostic and cause
СсылкаComprehension body type mismatch
- Семейство
- topaz
- Этап
- check
- Код
TPZ5610
Причина и условия
A comprehension body must satisfy the element type required by its collection context. An Array<int> comprehension whose body produces string must be rejected with the registered TPZ5610 diagnostic.
Действия
Make the body produce the expected element type, or change the collection annotation to match the intended data.
Compiler phase: check.
Compiler explanation: A comprehension body does not match the element type required by its expected context.
Message templates are Pending. The explanation above is not an observed CLI message.
A comprehension body must satisfy the element type required by its collection context. An Array<int> comprehension whose body produces string must be rejected with the registered TPZ5610 diagnostic.
Comprehension body and expected element type
A comprehension body must satisfy the element type required by its collection context. An Array<int> comprehension whose body produces string must be rejected with the registered TPZ5610 diagnostic.
Response
СсылкаMake the body produce the expected element type, or change the collection annotation to match the intended data.
Reproduction and verification
СсылкаRejected program
Ссылкаlet values: Array<int> = [for value in ([1]) => "text"]
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения check. Ненулевой код завершения.
comprehension-body-type-mismatch
Контракт обязательного основного местоположения не определён.
The source establishes a TPZ5001 collection mismatch for this input. The product assertion retains the intended TPZ5610 identity. Its dedicated message and primary location remain undetermined; the cause matcher recognizes the actual source-backed mismatch text.
Repaired program
Ссылкаlet values: Array<int> = [for value in ([1]) => value]
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.
The source establishes a TPZ5001 collection mismatch for this input. The product assertion retains the intended TPZ5610 identity. Its dedicated message and primary location remain undetermined; the cause matcher recognizes the actual source-backed mismatch text.