www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16971] New: Misleading error messages "break is not inside

https://issues.dlang.org/show_bug.cgi?id=16971

          Issue ID: 16971
           Summary: Misleading error messages "break is not inside
                    scope(exit) bodies" "continue is not inside
                    scope(exit) bodies"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: acehreli yahoo.com

void main() {
    for (;;) {
        scope (exit) break;
        scope (exit) continue;
    }
}

  Error: break is not inside scope(exit) bodies
  Error: continue is not inside scope(exit) bodies

The error messages are missing something like "allowed" as in

   "... is not allowed inside ..."

Ali

--
Dec 14 2016