www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5104] New: Forward reference error with member pure function S.fun(S s)

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

           Summary: Forward reference error with member pure function
                    S.fun(S s)
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: rsinfu gmail.com


--- Comment #0 from Shin Fujishiro <rsinfu gmail.com> 2010-10-23 00:36:15 PDT
---
dmd trunk r727.  Forward reference error happens if a member pure function of
struct S has a parameter of the type S:
--------------------
struct S
{
    bool fun(S s) pure { return true; }
}
--------------------
% dmd -o- -c test.d
test.d(2): Error: struct test.S no size yet for forward reference
--------------------

The error happens in TypeStruct::hasPointers() called from
TypeFunction::semantic() around line 5011 of mtype.c:
--------------------
            }
        }
        Type *t = fparam->type->toBasetype();
      if (!t->hasPointers())
continue; if (t->mod & (MODimmutable | MODwild)) continue; -------------------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 23 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5104


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |FIXED


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-11-08 19:01:28 PST ---
Fixed DMD2.050

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