template instance does not match template declaration

Paul Backus snarwin at gmail.com
Sat Feb 26 00:10:29 UTC 2022


On Friday, 25 February 2022 at 23:34:59 UTC, kdevel wrote:
>
> What about this:
>
> ```d
> module model; // model.d
> import std.file : read; // this line provokes the error
>
> private int read (string filename) // now it's private
> {
>    import std.file;
>    auto data = std.file.read (filename);
>    return 0;
> }
> ```
>
> Now dmd reports:
> ```
> main.d(7): Error: undefined identifier `read`
> ```
>
> Is the lookup and the processing done in different parts/stages 
> of the compiler?

I'm not familiar enough with the details of this part of the 
compiler to say. But it sure looks like there's something screwy 
going on here.


More information about the Digitalmars-d-learn mailing list