http://d.puremagic.com/issues/show_bug.cgi?id=3960



--- Comment #19 from Marco Leise <marco.le...@gmx.de> 2012-02-09 01:15:45 PST 
---
(In reply to comment #18)
> Whether or not a parameter is used is unrelated to whether or not it has a
> name.

You can't use an unnamed parameter, or can you?
What I wanted to hint at is this:

interface I {
  void foo(int a, int b);
}

class C {
  int sum_a;
  void foo(int a, int b) {
    sum_a += a;
  }
}

This is a typical situation I face in Java code. The IDE (Eclipse in this case)
would warn me, that I don't use parameter 'b'. Now my code is perfectly fine
and my implementation of foo() doesn't depend on the value of 'b' to do its
job.
The better solution is to write:

  void foo(int a, int) {
    sum_a += a;
  }

Now the interface is happy, as is the compiler check, because we made it clear,
that we intended to ignore 'b'.

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

Reply via email to