scriptsharp icon indicating copy to clipboard operation
scriptsharp copied to clipboard

Unable to access private instance method from static method of same class

Open aronmek opened this issue 14 years ago • 0 comments

Here is the code

public class Utilizer {
    public static void Crash(Container container) {
        container.Utilizer.Crahser();
    }

    private void Crahser() {

    }
}

public class Container {

    private Utilizer utilizer;

    public Utilizer Utilizer {
        get {
            return utilizer;
        }
        set {
            utilizer = value;
        }
    }
}

looks like because it's calling a method from an instance variable in the argument of the same type of the static method.

Edit (10/31, nikhilk): edited title to something more specific to reflect the issue

aronmek avatar Oct 30 '11 19:10 aronmek