Proposed improvements to the separate compilation model

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Jul 22 15:27:42 PDT 2011


On 7/22/11 5:06 PM, Andrei Alexandrescu wrote:
[snip]

I almost forgot - we should also have a means to allow a class to import 
its own incomplete declaration, as follows:

// a.di
class A { private int x; int foo(); }

// a.d
import a;
class A { private int x; int foo() { return x + 1; }

The compiler should accept this because that's what the .di generator 
outputs. The import will be used as a means to verify that the layout 
declared in the .di file is identical to the one in the .d file.

Without this feature, it would be impossible for the compiler to ensure 
that no inadvertent change was made to one of the files.


Andrei


More information about the Digitalmars-d mailing list