class Test { int foo() { return 1; } } void main() { Test test = null; int i = test != null ? test.foo() : 0; } This throws access violation exception