Bug 8082 – Invalid error messages based on module compilation order

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-11T02:56:00Z
Last change time
2013-09-17T14:30:14Z
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2012-05-11T02:56:30Z
main.d that references an undefined function: module main; void main() { test(); // invalid call } and util.d: module util; import std.algorithm; bool canFindAny(string[] inputs, string target1) { foreach (input; inputs) { if (target1.canFind(input)) return true; } return false; } $ dmd main.d util.d main.d(4): Error: undefined identifier test D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(2837): Error: template std.algorithm.find does not match any function template declaration D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(2837): Error: template std.algorithm.find cannot deduce template function from argument types !("a == b",ubyte[],ubyte[])(ubyte[],ubyte[]) D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(2836): Error: template instance find!("a == b",ubyte[],ubyte[]) errors instantiating template Only the first error message should appear. If you comment out the call to "test()" in main.d, all errors are gone. Note that the order of compiling the modules changes the behavior, see: $ dmd util.d main.d $ main.d(4): Error: undefined identifier test $ dmd main.d util.d $ main.d(4): Error: undefined identifier test D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(2837): Error: template std.algorithm.find does not match any function template declaration D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(2837): Error: template std.algorithm.find cannot deduce template function from argument types !("a == b",ubyte[],ubyte[])(ubyte[],ubyte[]) D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(2836): Error: template instance find!("a == b",ubyte[],ubyte[]) errors instantiating template
Comment #1 by andrej.mitrovich — 2013-09-17T14:30:14Z
Seems to be fixed in 2.063.2.