https://issues.dlang.org/show_bug.cgi?id=20808
--- Comment #4 from Adam D. Ruppe <[email protected]> --- It modifies a const inside the opAssign which is why it fails. That's not supposed to be allowed so the error should happen. All opDispatch does is forward directly to opIndexAssign, so if opIndexAssign doesn't compile, opDispatch shouldn't either. You can call the assigned function by adding globals.printInt()(); // be sure to use double parens thanks @property if you take that const off the function definition, it works fine in either case showing the assignment was successful. But the const back on and you get error in the direct opIndexAssign and... silence on opDispatch. You can even do globals.opDispatch!"printInt" = &printInt; to get the error. --
