View mode: basic / threaded / horizontal-split · Log in · Help
January 14, 2013
[Issue 9317] New: ParameterStorageClassTuple reports errors for inout function
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


--- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 2013-01-14 06:47:34 PST ---
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: -------
January 14, 2013
[Issue 9317] ParameterStorageClassTuple reports errors for inout function
http://d.puremagic.com/issues/show_bug.cgi?id=9317


Dicebot <m.strashun@gmail.com> changed:

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


--- Comment #1 from Dicebot <m.strashun@gmail.com> 2013-01-14 06:51:04 PST ---
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: -------
January 14, 2013
[Issue 9317] ParameterStorageClassTuple reports errors for inout function
http://d.puremagic.com/issues/show_bug.cgi?id=9317



--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2013-01-14 07:02:54 PST ---
(In reply to comment #1)
> 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: -------
January 14, 2013
[Issue 9317] ParameterStorageClassTuple reports errors for inout function
http://d.puremagic.com/issues/show_bug.cgi?id=9317


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

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


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2013-01-14 07:08:45 PST ---
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: -------
January 14, 2013
[Issue 9317] ParameterStorageClassTuple reports errors for inout function
http://d.puremagic.com/issues/show_bug.cgi?id=9317



--- Comment #4 from Dicebot <m.strashun@gmail.com> 2013-01-14 07:18:17 PST ---
(In reply to comment #2)
> 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: -------
January 14, 2013
[Issue 9317] ParameterStorageClassTuple reports errors for inout function
http://d.puremagic.com/issues/show_bug.cgi?id=9317



--- Comment #5 from Kenji Hara <k.hara.pg@gmail.com> 2013-01-14 07:35:48 PST ---
(In reply to comment #4)
> (In reply to comment #2)
> > 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: -------
January 15, 2013
[Issue 9317] ParameterStorageClassTuple reports errors for inout function
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: -------
January 15, 2013
[Issue 9317] ParameterStorageClassTuple reports errors for inout function
http://d.puremagic.com/issues/show_bug.cgi?id=9317



--- Comment #6 from github-bugzilla@puremagic.com 2013-01-15 15:24:38 PST ---
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
Merge pull request #1073 from 9rnsr/fix9317

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: -------
Top | Discussion index | About this forum | D home