www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10544] New: writeln!(inout(int)) does not work

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10544

           Summary: writeln!(inout(int)) does not work
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrei erdani.com



PDT ---
Refer to
http://stackoverflow.com/questions/17460065/how-to-print-inout-parameters for
details. In all likelihood Unqual is the culprit.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 04 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10544


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid



https://github.com/D-Programming-Language/phobos/pull/1397

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 07 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10544




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


Issue 10544 - writeln!(inout(int)) does not work

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 07 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10544


gerleim <gerleim2 gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gerleim2 gmail.com



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;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 08 2013