[Issue 19126] Compiler removes inout on templated parameter and then complains it's not there

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 1 14:43:50 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19126

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal

--- Comment #4 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Aye, the compiler is stripping inout from the type because it knows that
inout(immutable(T)) can be rewritten as immutable(T). It's not necessarily a
bug in the translation (though the error really is questionable). It's a bug in
the diagnostic message -- it's saying you didn't put inout on the parameter,
when you clearly did.

The bug in the first comment was not in the original example that showed the
error, it was a copy-paste error (as you have discovered, it still fails).

--


More information about the Digitalmars-d-bugs mailing list