[Issue 3960] Unused variable warning

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 17 05:30:04 PDT 2010


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



--- Comment #1 from bearophile_hugs at eml.cc 2010-03-17 05:30:02 PDT ---
A related warning can be see with this C# program:


using System;
namespace Test {
    class Foo {
        int x;
        private void Add(int y) {
            x += y;
        }
        static void Main() {
            System.Console.WriteLine("test");
        }
    }
}



Compiled with mono:
...gmcs test.cs
test.cs(5,22): warning CS0169: The private method `Test.Foo.Add(int)' is never
used
Compilation succeeded - 1 warning(s)


In D private methods can be used by other functions in the same module, so it's
less easy to produce a warning like this.

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


More information about the Digitalmars-d-bugs mailing list