Can call static method with null reference

Namespace rswhite4 at googlemail.com
Thu Jun 20 12:13:37 PDT 2013


I had expected that the following code would crash:
It it intended?

----
import std.stdio;

class Foo {
public:
	static void test1() { }
	void test2() { }
}

void main()
{
	Foo.test1();
	/// Foo.test2(); crash as expected
	
	Foo f;
	f.test1(); /// works o.O - should crash?
	/// f.test2(); also crash - null pointer
}
----



More information about the Digitalmars-d-learn mailing list