To elaborate a bit on the previous answer:

On 10.01.2015 17:12, Tobias Leich wrote:
In case we would know that certain methods had no side effects (and are
not called because of their side effects), ...

But at the moment we don't know and therefore we can't warn for every

there are two possible choices for warnings: run time and compile time.

Run-time warnings suffer from run-time overhead, and I think this would be unacceptable here.

Compile-time warnings can't work here, because at compile time we don't know what method we'll dispatch to eventually. Note that subroutine calls already have such warnings (in some cases):

$ perl6-m -e 'sqrt(4); say "done"'
Useless use of "sqrt(4)" in expression "sqrt(4)" in sink context (line 1)

Reply via email to