Diagnostic and cause
СсылкаVariadic parameter is not final
- Семейство
- topaz
- Этап
- check
- Код
TPZ5024
Причина и условия
A variadic parameter must be the final parameter of its declaration or function type.
Связанное правило · Variadic parameter is not final →Действия
Move the variadic parameter to the end of the declaration or function type.
Compiler phase: check.
Compiler explanation: A variadic function type or parameter list puts the variadic slot before another slot.
Message templates are Pending. The explanation above is not an observed CLI message.
A variadic parameter must be the final parameter of its declaration or function type.
Variadic parameter is not final
A variadic parameter must be the final parameter of its declaration or function type.
Response
СсылкаMove the variadic parameter to the end of the declaration or function type.
Reproduction and verification
СсылкаRejected program
Ссылкаfunction tail(...values: int, last: int) -> int { last }
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения check. Ненулевой код завершения.
diagnostics-variadic-not-final
Контракт обязательного основного местоположения не определён.
The intended rejection is recorded as an implementation limitation. A current SELF producer does not establish the diagnostic source location, so that location remains Pending.
Repaired program
Ссылкаfunction tail(last: int, ...values: int) -> int { last }
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.
The intended rejection is recorded as an implementation limitation. A current SELF producer does not establish the diagnostic source location, so that location remains Pending.