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

BoQsc vaidas.boqsc at gmail.com
Thu Nov 2 11:12:58 UTC 2023


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
>> 
>
> ```
> --- waffles/program.d
> import waffles;
> ```
>
> See https://dlang.org/spec/module.html#package-module

Weirdly enough it does not work on Windows operating system.


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

```
program.d(1): Error: unable to read module `waffles`
program.d(1):        Expected 'waffles.d' or 'waffles\package.d' 
in one of the following import paths:
import path[0] = .
import path[1] = C:\D\dmd2\windows\bin\..\..\src\phobos
import path[2] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
Failed: ["C:\\D\\dmd2\\windows\\bin\\dmd.exe", "-v", "-o-", 
"program.d", "-I."]

C:\waffles>dmd -i -run program.d
program.d(1): Error: unable to read module `waffles`
program.d(1):        Expected 'waffles.d' or 'waffles\package.d' 
in one of the following import paths:
import path[0] = C:\D\dmd2\windows\bin64\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin64\..\..\src\druntime\import

```


More information about the Digitalmars-d-learn mailing list