What is this error?!

Jonathan M Davis jmdavisProg at gmx.com
Wed Apr 25 10:05:22 PDT 2012


On Wednesday, April 25, 2012 03:01:23 Mehrdad wrote:
> Trying to compile
> import std.stdio, std.cstream;
> alias file a;
> gives
> [...]\windows\bin\..\..\src\phobos\std\stdio.d(257): Error: struct
> std.stdio.File conflicts with class std.stream.File at
> [...]\windows\bin\..\..\src\phobos\std\stream.d(1807)
> [...]\Temp2.d(2): Error: undefined identifier file, did you mean struct
> File?
> 
> IMHO the first error is a little silly...

The first error makes perfect sense if you use File with both of those imports, 
but you used _file_, not File, so that's definitely weird. It's almost like the 
alias is being dealt with in a case-insensitive manner, which it shouldn't be.

My _guess_ would be that it's simply an issue with the spell checker - since 
that _would_ look into other cases. It probably is looking for symbols close 
to file, finds File in both std.stdio and std.cstream, and then ends up spitting 
out an error due to the conflict. It _shouldn't_, since the module isn't 
actually using File, but I guess that however the spell checker works, it 
ended up acting like it was importing it. Certainly, it looks like a bug.

- Jonathan M Davis


More information about the Digitalmars-d mailing list