www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 216] New: ridiculous error message

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

           Summary: ridiculous error message
           Product: D
           Version: 0.161
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: h3r3tic mat.uni.torun.pl


The code below compiles:

// console_main.d
alias uint DataKey;


struct Output {
        template mix()
        {
                template writei() {
                        void writei(DataKey k) {}
                }

                void write(DataKey k) {
                        writei!()(k);
                }
        }
}


class Kernel {
        // this() {}
}


class Foo : Kernel {
        mixin Output.mix mixer;
}


void main() {
}
// ----

Now, try uncommenting the ctor in the Kernel class.
Result:

console_main.d(8): identifier 'DataKey' is not defined


-- 
Jun 21 2006
next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-06-22:
 http://d.puremagic.com/issues/show_bug.cgi?id=216

 The code below compiles:

 // console_main.d
 alias uint DataKey;


 struct Output {
         template mix()
         {
                 template writei() {
                         void writei(DataKey k) {}
                 }

                 void write(DataKey k) {
                         writei!()(k);
                 }
         }
 }


 class Kernel {
         // this() {}
 }


 class Foo : Kernel {
         mixin Output.mix mixer;
 }


 void main() {
 }
 // ----

 Now, try uncommenting the ctor in the Kernel class.
 Result:

 console_main.d(8): identifier 'DataKey' is not defined

Added to DStress as http://dstress.kuehne.cn/run/t/template_36_A.d http://dstress.kuehne.cn/run/t/template_36_B.d http://dstress.kuehne.cn/run/t/template_36_C.d http://dstress.kuehne.cn/run/t/template_36_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEqARLLK5blCcjpWoRAvF8AJ4nQ24IuOZr0YvlKvA+znYymMNivACgoE/u c76F01E2BIIYZ+WopksnIm0= =eMUM -----END PGP SIGNATURE-----
Jul 02 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=216


wbaxter gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal




------- Comment #1 from wbaxter gmail.com  2006-12-17 02:30 -------
maybe I shouldn't have taken it upon myself to do this, but it doesn't seem
like a bad error message really warrants a category "major".  "Minor" would be
more like it, but I'll settle for "normal".


-- 
Dec 17 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=216





------- Comment #2 from braddr puremagic.com  2007-09-17 00:42 -------
This bug is no longer visible with dmd versions 1.021 or 2.004.

Thomas, can you confirm that it's ok to close?


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


bugzilla digitalmars.com changed:

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




------- Comment #3 from bugzilla digitalmars.com  2007-10-02 15:02 -------
Works in DMD 1.021 and 2.004.


-- 
Oct 02 2007