https://issues.dlang.org/show_bug.cgi?id=18863
Simen Kjaeraas <simen.kja...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |simen.kja...@gmail.com Resolution|--- |INVALID --- Comment #1 from Simen Kjaeraas <simen.kja...@gmail.com> --- You've got a bug in your code: ++x has to fail for the template case, since you're trying to increment a compile-time value. This is what the call to bar is lowered to: Foo!1.opDispatch!"bar"() When you try and compile that, you get these error messages: Error: cannot modify constant 1 Error: template instance `foo.Foo!1.Foo.opDispatch!"bar"` error instantiating --