[Issue 11880] New: Reserve the keyword "yield"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 7 18:38:04 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11880

           Summary: Reserve the keyword "yield"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2014-01-07 18:38:02 PST ---
I suggest to reserve the keyword "yield" for future usage (just like the
keyword "macro", "cent", "ucent"). This will avoid backward compatibility
problems with D code that uses variable names "yield" today.

See Issue 5660 for info on "yield".


Today code that uses "yield" should give an explicit error message like this:

test.d(2): Error: yield not implemented


And this should compile:

void main() {
    static assert(!__traits(compiles, { yield(int) foo() { yield 1; }}));
}

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


More information about the Digitalmars-d-bugs mailing list