The attached code fails with the following errors: lol.d(14): Error: template instance opCast!(Object) opCast!(Object) does not match template declaration opCast(T : int) lol.d(14): Error: function expected before (), not a.opCast!(Object) of type void I've been told to open a bug about it, so here it is.
Created attachment 1105 [details] Reduced testcase
If to avoid the first error I add an opCast!(Object), it works with == but fails in a weird way when casting. Following an attachment that shows said behavior.
Created attachment 1107 [details] Reduced test case for weird cast behavior.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17550 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB