[Issue 3301] Undefined identifier error dependent on order of imports when a circular import is involved

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 19 13:37:05 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3301



--- Comment #13 from Eldar Insafutdinov <e.insafutdinov at gmail.com> 2009-09-19 13:37:03 PDT ---
(In reply to comment #12)
> Created an attachment (id=454) [details]
> do all imports before semantic analysis
> 
> Having done some investigation of the deferred semantic analysis mechanism, it
> might be best to try to keep its usage to a minimum, because it might have a
> negative impact on compilation speed and memory consumption. So my patch is
> probably not so bad after all.
> 
> Some details: 
> The problem is that, though the files are parsed, their symbol table might not
> yet hold any identifiers, because the semantic analysis has not been run on the
> module.
> 
> So I introduced another compile step after parsing, but before the semantic
> analysis. The files on the command line are scanned for import statements,
> loading and parsing the referenced modules and applying the same process on
> these files. In the same step, the global members of the module are added to
> the modules' symbol table (this has been moved from the semantic analysis).
> 
> The import statements must not be conditional, because the semantic analysis is
> needed to evaluate a "static if" statement. If the semantic analysis gets to
> the import statement, the additional compile step kicks in again for any module
> not already loaded.
> 
> This patch also fixes bugs #3286, #1592 and #258

Dear Rainer,
Your patch applied against dmd 1.047 fixes the issue with building both gtkD
and QtD. It would be cool if it were included in the upstream.

Thank you.

-- 
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