www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6202] New: Inferring function return type with attributes on both sides of signature

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

           Summary: Inferring function return type with attributes on both
                    sides of signature
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bugzilla kyllingen.net



13:18:39 PDT ---
Test case:

     property foo() pure { return 1; }

Error:

    a.d(1): function declaration without return type.
    (Note that constructors are always named 'this')
    a.d(1): no identifier for declarator pure foo()

Both ' property' and 'pure' can be exchanged for any of  safe, nothrow, const,
etc. -- the point is that one attribute comes before the function signature and
the other comes after.

If 'pure' is removed, the return type is successfully inferred to be int.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 23 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6202


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |INVALID



13:21:00 PDT ---
Already fixed:

https://github.com/D-Programming-Language/dmd/commit/6a15077f8189e1ef203565edaebc766446aa105b

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