www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8447] New: Self importing is allowed?

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

           Summary: Self importing is allowed?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dmitry.olsh gmail.com



13:59:15 PDT ---
Program:

module huh;
import huh;

compiles alright.

However the same thing in a bigger project cased spurious forward references
around std.conv.text. (Sorry failed to reduce.)

Shouldn't compiler just statically disallow self-importing ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 26 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8447


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



20:29:10 PDT ---
Phobos has a couple of these self-imports. They all seem to be in unittest
blocks, which maybe makes copy-pasting samples to outside modules easier since
you automatically get a free import statement included.

Maybe we should allow them in function/unittest scope, and disallow them in
module scope. Or should we just ban them outright?

I'm running a test suite on a fix right now.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 04 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8447


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



13:13:23 PST ---
Going to close it for a moment as the codebase changed radically over time and
I'm not 100% sure self-importing was the core cause.

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