Thread overview
" include imported modules in the compilation " should exclude di file
Mar 09, 2020
Calvin P
Mar 09, 2020
Calvin P
Mar 19, 2020
Mathias Lang
March 09, 2020
The current compiler "-i=module_name" option will  include imported modules as source code.

When the module define from di file extension, I think compiler should avoid treat it as source file.

What do you think?
March 09, 2020
On Monday, 9 March 2020 at 13:55:08 UTC, Calvin P wrote:
> The current compiler "-i=module_name" option will  include imported modules as source code.
>
> When the module define from di file extension, I think compiler should avoid treat it as source file.
>
> What do you think?

The use case:

If I want to define a collection function only use for ctfe, I can put them into di file to avoid binary bloat.


It also can be used create helper module for BetterC library,  so you can use "new Struct" in the di and import it from betterC module.  without use "-I=-lib_helper" to exclude every helper module in the library.


March 19, 2020
On Monday, 9 March 2020 at 13:55:08 UTC, Calvin P wrote:
> The current compiler "-i=module_name" option will  include imported modules as source code.
>
> When the module define from di file extension, I think compiler should avoid treat it as source file.
>
> What do you think?

Sounds sensible. Can you raise a bug report ?