[Issue 18863] opDispatch with WithStatement & Template Instance
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed May 16 08:56:52 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18863
Simen Kjaeraas <simen.kjaras at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |simen.kjaras at gmail.com
Resolution|--- |INVALID
--- Comment #1 from Simen Kjaeraas <simen.kjaras at 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
--
More information about the Digitalmars-d-bugs
mailing list