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

BoQsc vaidas.boqsc at gmail.com
Thu Nov 2 10:37:03 UTC 2023


![](https://i.imgur.com/829CzOS.png)

Source File **package.d** is a [package module][1] which contains 
import statements to import other modules.

How would one import a **package.d** module when [**keyword 
"package"**][2] is preventing that?



[1]: https://dlang.org/spec/module.html#package-module
[2]: https://dlang.org/spec/attribute.html#visibility_attributes

Example:
```
import package;
```
Error:

```
datatypes.d(1): Error: identifier expected following `import`
datatypes.d(1): Error: `;` expected
```
---
#### [Extensive run.dlang.io 
example](https://run.dlang.io/is/f3jURn)

Expected correct result if `package.d` was possible to import:

```
waffles/program.d(6): Error: `num` matches conflicting symbols:
waffles/testing1.d(1):        variable `testing1.num`
waffles/testing2.d(1):        variable `testing2.num`
```


More information about the Digitalmars-d-learn mailing list