[Issue 6202] New: Inferring function return type with attributes on both sides of signature

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 23 13:23:28 PDT 2011


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 at puremagic.com
        ReportedBy: bugzilla at kyllingen.net


--- Comment #0 from Lars T. Kyllingstad <bugzilla at kyllingen.net> 2011-06-23 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: -------


More information about the Digitalmars-d-bugs mailing list