www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9317] New: ParameterStorageClassTuple reports errors for inout function

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

           Summary: ParameterStorageClassTuple reports errors for inout
                    function
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



Separation from: http://d.puremagic.com/issues/show_bug.cgi?id=8695#c1

-----------------
import std.traits;

inout int func(inout int param)
{
    return param;
}

void main()    
{
    alias stcs = ParameterStorageClassTuple!(typeof(func));
    pragma(msg, stcs);
}
-----------------
/usr/local/include/dmd2/std/traits.d(97): Error: key 'g' not found in
associative array
['a':cast(FunctionAttribute)1u,'b':cast(FunctionAttribute)2u,'c':cast(FunctionAttribute)4u,'d':cast(FunctionAttribute)8u,'e':cast(FunctionAttribute)16u,'f':cast(FunctionAttribute)32u]
/usr/local/include/dmd2/std/traits.d(458): called from here:
demangleFunctionAttributes("NgiZi"c)
/usr/local/include/dmd2/std/traits.d(97): Error: key 'g' not found in
associative array
['a':cast(FunctionAttribute)1u,'b':cast(FunctionAttribute)2u,'c':cast(FunctionAttribute)4u,'d':cast(FunctionAttribute)8u,'e':cast(FunctionAttribute)16u,'f':cast(FunctionAttribute)32u]
/usr/local/include/dmd2/std/traits.d(458): called from here:
demangleFunctionAttributes("NgiZi"c)
/home/c565/c253.d(10): Error: template instance
std.traits.ParameterStorageClassTuple!(inout int(inout(int) param)) error
instantiating
demangleNextParameter!(demangleFunctionAttributes("NgiZi"c).rest)
-----------------

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


Dicebot <m.strashun gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m.strashun gmail.com



Quick investigation: this is actually more related to demangleXXX family of
functions in std.traits
Their type system awareness seems a bit out of date :)

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





 Quick investigation: this is actually more related to demangleXXX family of
 functions in std.traits
 Their type system awareness seems a bit out of date :)
As far as I see, demangleParameterStorageClass has no problem. In current, the set of valid parameter storage classes is (scope, out ref, lazy). And `inout` is always treated as a type qualifier, so is not contained the set. On the other hand, demangleFunctionAttributes has the problem that just reported here. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 14 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9317


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



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

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





 In current, the set of valid parameter storage classes is (scope, out ref,
 lazy).
 And `inout` is always treated as a type qualifier, so is not contained the set.
Is there any single place on dlang.org or in TDPL where this can be read? I am struggling to find proper classification of D type system since the very start of work on fullyQualifiedTypeName. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 14 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9317






 In current, the set of valid parameter storage classes is (scope, out ref,
 lazy).
 And `inout` is always treated as a type qualifier, so is not contained the set.
Is there any single place on dlang.org or in TDPL where this can be read? I am struggling to find proper classification of D type system since the very start of work on fullyQualifiedTypeName.
Mostly complete thing is here. http://dlang.org/function#parameters - const, immutable, share, and inout implicitly qualify the parameter type. That means, foo(const T param) is implicitly translated to foo(const(T) param). After that, they will not remain as actual 'storage class'. - The description >>'in' equivalent to 'const scope'<< is not correct. With current compiler implementation, 'in' is just treated as 'const'. So it's treated as a part of type, and will not remain as actual 'storage class' - Remaining four, 'ref', 'scope', 'lazy', and 'out' will have actual meanings as 'storage class'. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 14 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9317


Alex Rønne Petersen <alex lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alex lycus.org
         Resolution|                            |FIXED


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




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/dd42a751067df54ca181f4f87b9274611a298bfc
fix Issue 9317 - ParameterStorageClassTuple reports errors for inout function

https://github.com/D-Programming-Language/phobos/commit/afe4ba151d673fa2d115922bad016c163789e55c


Issue 9317 - ParameterStorageClassTuple reports errors for inout function

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