www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1075] New: dmd reject valid code

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

           Summary: dmd reject valid code
           Product: D
           Version: 1.009
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: davidl 126.com


class test
{
        static char[] c(){return "whateever;";}
        int a;
        class b
        {
                mixin(c());
        }
}
void main()
{

}
after reviewing the document i think my example above should be compilable


-- 
Mar 21 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1075


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #1 from bugzilla digitalmars.com  2007-03-21 13:16 -------
Static strings can be modified at runtime, which is why this isn't compilable
(it must be known at compile time). Try doing static const char[] instead, that
should work.


-- 
Mar 21 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1075


fvbommel wxs.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




------- Comment #2 from fvbommel wxs.nl  2007-03-21 18:29 -------
(From comment #0)
         static char[] c(){return "whateever;";}

(In reply to comment #1)
 Static strings can be modified at runtime, which is why this isn't compilable
 (it must be known at compile time). Try doing static const char[] instead, that
 should work.

That's not a static string, that's a static method he's trying to use for CTFE... (Reopening not because I'm sure this should be allowed, but because it was IMHO closed for the wrong reason) --
Mar 21 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1075





------- Comment #3 from davidl 126.com  2007-03-22 00:43 -------
class test
{
        static const char[] c(){return "whateever;";}
        int a;
        class b
        {
                mixin(c());
        }
}
void main()
{

}

even above ain't compilabe


-- 
Mar 21 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1075


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com




------- Comment #4 from smjg iname.com  2007-03-23 13:38 -------
I don't quite see why it should.  It would be equivalent to

class test
{
    int a;
    class b
    {
        whateever;
    }
}

but "whateever;" isn't a valid declaration.

If that's just a placeholder, using placeholders like this in code samples
isn't a good idea.  The problem could still be down to what you're trying to
use in that place.  Always use something that a user can test straight out of
the box.


-- 
Mar 23 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1075





------- Comment #5 from davidl 126.com  2007-03-27 23:49 -------
class test
{
        static char[] c(){return "this(){};";}
        int a;
        class b
        {
                mixin(c());
        }
}
void main()
{

}

heh, this is an example should be compilable ;)


-- 
Mar 27 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1075


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All




------- Comment #6 from thomas-dloop kuehne.cn  2007-04-04 12:34 -------
Added to DStress as
http://dstress.kuehne.cn/run/m/mixin_30_A.d
http://dstress.kuehne.cn/run/m/mixin_30_B.d
http://dstress.kuehne.cn/run/m/mixin_30_C.d
http://dstress.kuehne.cn/run/m/mixin_30_D.d
http://dstress.kuehne.cn/run/m/mixin_30_E.d


-- 
Apr 04 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1075


davidl 126.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |samukha voliacable.com




------- Comment #7 from davidl 126.com  2007-09-08 23:04 -------
*** Bug 1447 has been marked as a duplicate of this bug. ***


-- 
Sep 08 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1075


davidl 126.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




------- Comment #8 from davidl 126.com  2007-09-08 23:06 -------
fixed in dmd 1.021


-- 
Sep 08 2007