www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1248] New: Weird error "... of type TOK146" on recursive type definition

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

           Summary: Weird error "... of type TOK146" on recursive type
                    definition
           Product: D
           Version: 1.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: brunodomedeiros+bugz gmail.com


This code:
-----  ----
void func(functype param) {
        param(null);
}

alias typeof(&func) functype;
----
breaks with:
"main.d(3): Error: function expected before (), not param of type TOK14"
I'm not sure if the code above is valid or not, but at least the error message
is broken.


-- 
May 26 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1248






Here's a minor variant:
----
functype func(int param) {
        return null;
}

alias typeof(&func) functype;
----
"main.d(3): Error: cannot implicitly convert expression (null) of type void* to
TOK146"
Definitely a bug.


-- 
May 26 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1248


bugzilla digitalmars.com changed:

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





Works in DMD 1.0017 and 2.001.


-- 
Jun 28 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1248


thomas-dloop kuehne.cn changed:

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





Added to DStress as
http://dstress.kuehne.cn/run/t/typeof_17_A.d
http://dstress.kuehne.cn/run/t/typeof_17_B.d
http://dstress.kuehne.cn/run/t/typeof_17_C.d


-- 
Jul 23 2007