Keyword "package" prevents from importing a package module "package.d"

Imperatorn johan_forsberg_86 at hotmail.com
Thu Nov 2 11:32:40 UTC 2023


On Thursday, 2 November 2023 at 11:12:58 UTC, BoQsc wrote:
> On Thursday, 2 November 2023 at 10:53:12 UTC, Arafel wrote:
>> On 02.11.23 11:45, BoQsc wrote:
>>> Edit incorrect link to example:
>>>> #### [Extensive run.dlang.io 
>>>> example](https://run.dlang.io/is/f3jURn)
>>> 
>>> Correct link:
>>> https://run.dlang.io/is/Zbrn75


```d
--- waffles/program.d
import waffles;

void main()
{
     import std;

     writeln(num);
}

--- waffles/package.d
module waffles;

public import waffles.testing1;
public import waffles.testing2;

--- waffles/testing1.d
int num = 5;

--- waffles/testing2.d
int num2 = 9;
```


More information about the Digitalmars-d-learn mailing list