Background:
#1413 proposed that call statements may only call a function or builtin with no return value, and that call expressions must be consumed by a statement. #1651 introduced this rule with the line:
If the called function returns a value, that value must be consumed either through assignment, evaluation in another expression or through use of the ignore built-in function
ignore() was added in #1587, and its original use was to allow an "escape-hatch" for cases where the user needs to call a function that returns a value, and doesn't actually want to use that returned value.
Since ignore() was added to the spec, it has found additional use for ensuring that binding points are referenced by a given entry point (this is possibly a Tint <-> Dawn implementation detail that needs spec clarification).
In #2115 we're discussing replacing ignore() with _.
We're now getting feedback 1 from users that this original rule may be too restrictive.
For example: it's common to want to call atomicAdd() without using the returned "old" value.
I'm filing this issue so we can re-evaluate whether the rule to always consume a call return value is worth keeping.
Background:
#1413 proposed that call statements may only call a function or builtin with no return value, and that call expressions must be consumed by a statement. #1651 introduced this rule with the line:
ignore()was added in #1587, and its original use was to allow an "escape-hatch" for cases where the user needs to call a function that returns a value, and doesn't actually want to use that returned value.Since
ignore()was added to the spec, it has found additional use for ensuring that binding points are referenced by a given entry point (this is possibly a Tint <-> Dawn implementation detail that needs spec clarification).In #2115 we're discussing replacing
ignore()with_.We're now getting feedback 1 from users that this original rule may be too restrictive.
For example: it's common to want to call
atomicAdd()without using the returned "old" value.I'm filing this issue so we can re-evaluate whether the rule to always consume a call return value is worth keeping.