On Sat, 28 Oct 2017 14:57:21 +0200, Mike Wey wrote:

this line:

ProfilePreferenceRow row = 
cast(ProfilePreferenceRow)lbSide.getSelectedRow();

fails with dmd since getSelectedRow returns null and that then triggers
an assert when calling a member function.

With ldc it just calls the function while this == null and ends up
executing return cast(ProfilePreferenceRow)super, and returning null.

Since you can't define the opCast as a ufcs function and a static
doesn't have access to this the ldc behavior seens the desired behavior.

Thanks as always Mike, I saw your thread on the dlang forum about this as well. Hopefully it can be resolved in some way that doesn't involve a new compiler version. :)