[Issue 3882] Unused result of pure functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 1 16:16:27 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=3882



--- Comment #16 from bearophile_hugs at eml.cc 2014-03-01 16:16:25 PST ---
(In reply to comment #15)

> Here's my proposal:
> 
> t.d(30,17): Warning: Call to strictly pure function f() discards return value,
> prepend a cast(void) if intentional
> t.d(18,22):        function defined here

In general if a programmer is using an IDE it's easy to click on the function
name at the call point, and jump to the function definition. So the second line
is not necessary for programmers that use an IDE.

How is dmd acting in other situations for other errors/warnings? I think for
functions the second line where the function is defines is usually not given.

So perhaps a single error message like this is enough:

test.d(30,17): Warning: discarded return value of pure function 'test.foo',
prepend a cast(void) if intentional

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list