[Issue 5980] Can't pass __traits value as const(char)*

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 11 11:27:13 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5980


kennytm at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kennytm at gmail.com


--- Comment #2 from kennytm at gmail.com 2011-05-11 11:23:13 PDT ---
(In reply to comment #0)
> This worked in 2.052 but is failing to compile in the latest beta for 2.053.
> This is used by LuaD.
> 
> struct A {
>     int a;
> }
> void main() {
>     foreach(field; __traits(allMembers, A))
>     {    
>             usefield(field);
>     }
> 
> }
> 
> void usefield(const(char)* foo) {
> }

Why not use 'usefield(field.ptr)'? I don't think implicitly converting an array
to a pointer is expected.

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


More information about the Digitalmars-d-bugs mailing list