[Issue 15402] New: Make it an error to declare package level symbols when there is no package
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Thu Dec  3 16:01:32 PST 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15402
          Issue ID: 15402
           Summary: Make it an error to declare package level symbols when
                    there is no package
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: issues.dlang at jmdavisProg.com
As indicated by issue# 8716 and issue# 15395, at least occasionally, folks use
the package attribute on symbols in modules that aren't actually in a package
(since they're at the top level of the hierarchy). Given that it makes no sense
to use the package attribute on _anything_ in a top-level module, I'd suggest
that it be made into an error to do so. Certainly, it makes more sense than
allowing an unusable function to be declared and then make it an error to use
it, which is the current behavior.
--
    
    
More information about the Digitalmars-d-bugs
mailing list