Bug 10544 – writeln!(inout(int)) does not work

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-04T10:02:00Z
Last change time
2015-12-03T08:33:25Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2013-07-04T10:02:22Z
Refer to http://stackoverflow.com/questions/17460065/how-to-print-inout-parameters for details. In all likelihood Unqual is the culprit.
Comment #1 by k.hara.pg — 2013-07-07T23:31:47Z
Comment #2 by github-bugzilla — 2013-07-07T23:41:36Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/505ab39a1d22fa10cb11113c40406fd0271d0558 fix Issue 10544 - writeln!(inout(int)) does not work https://github.com/D-Programming-Language/phobos/commit/ecadde6ffd50013485273954b62fb68e6da40c82 Merge pull request #1397 from 9rnsr/fix10544 Issue 10544 - writeln!(inout(int)) does not work
Comment #3 by gerleim2 — 2013-07-08T03:19:54Z
Sorry if I am writing something silly, it's been a while ago I programed in D, it seems I skipped the whole inout thing. Feel free to modify/delete my comment or create new issue as you see fit. Isn't there a similar problem with Unsigned(T)? Something like unittest { alias Unsigned!(inout(int)) U4; static assert(is(U4 == inout(uint))); } What I get with Unqual (with the original writln issue) is that there is a problem with Unqual!(Unsigned!T), while Unqual!(T) does compile. In code: module main; import std.traits; int main(string[] argv) { const int x = 1; //TestCallGood(x); TestCallBad(x); return 0; } /*public void TestCallGood(int value) { Foo(value); }*/ public void TestCallBad(inout int value) { Foo(value); } public void Foo(T)(T value) { Unsigned!T z; //Unsigned!(inout(int)) is used as a type Unqual!(Unsigned!T) vBad = value; //template instance Unqual!(__T4ImplTNgiZ) does not match template declaration Unqual(T) Unqual!(T) vGood = value; }
Comment #4 by gerleim2 — 2015-12-03T08:33:25Z
This is fixed in https://github.com/D-Programming-Language/phobos/pull/1397/files and merged to master. Tested on dmd.2.069.2.windows.