Reported by bearophile. More of a Sea++ of errors, it reminds me of Another Language. It's because ScopeExp::semantic() doesn't use template instances if global.errors is true. Test case (not reduced, relies on D2 Phobos where writefln is a template): import std.stdio; T[] findroot(T)(in T x) { writefln("xxx"); } void main() { findroot(1.0L); }
Is this the same problem where an error in one module causes errors in completely different modules (e.g. Phobos)?
(In reply to comment #1) > Is this the same problem where an error in one module causes errors in > completely different modules (e.g. Phobos)? I don't think so. This is one is very simple, it's not a module order dependency, it's a failure to run semantic at all. But, it' Here is case b. Different symptoms, same root cause. The static assert should be triggered, despite the error in the enum declaration: ------------- struct W { void blaz(T)() {static assert(0); } } void main() { enum int blah = "abc"; W m; m.blaz!(int)(); }
OK. Here's the output of the problem I've encountered: C:\Projects\DFeed\ae\demo\http> dbuild httpserve.d C:\Projects\ae\sys\shutdown.d(24): Error: function ae.sys.signals.addSignalHandler (int signum, void delegate() fn) is not callable using argument types (int,void) C:\Projects\ae\sys\shutdown.d(24): Error: cannot implicitly convert expression (shutdown()) of type void to void delegate() Above are correct errors (I forgot a &). The error messages below are unrelated to the above problems, and go away after I add the &. C:\Soft\dmd2d\src\phobos\std\string.d(538): Error: expression isSomeChar!(char) of type void does not have a boolean value C:\Projects\ae\net\http\server.d(71): Error: template std.string.indexOf(Char) if (isSomeChar!(Char)) does not match any function template declaration C:\Projects\ae\net\http\server.d(71): Error: template std.string.indexOf(Char) if (isSomeChar!(Char)) cannot deduce template function from argument types !()(string,string ) C:\Soft\dmd2d\src\phobos\std\string.d(448): Error: constraint isSomeChar!(char) is not constant or does not evaluate to a bool C:\Soft\dmd2d\src\phobos\std\string.d(612): Error: constraint isSomeChar!(char) is not constant or does not evaluate to a bool C:\Soft\dmd2d\src\phobos\std\algorithm.d(3893): Error: expression isInputRange!(string) of type void does not have a boolean value C:\Soft\dmd2d\src\phobos\std\algorithm.d(3963): Error: expression isInputRange!(string) of type void does not have a boolean value C:\Soft\dmd2d\src\phobos\std\algorithm.d(4015): Error: expression isInputRange!(string) of type void does not have a boolean value C:\Projects\ae\net\http\server.d(93): Error: template std.algorithm.startsWith(alias pred = "a == b",Range,Ranges...) if (isInputRange!(Range) && Ranges.length > 1 && is(t ypeof(.startsWith!(pred)(doesThisStart,withOneOfThese[0])) : bool) && is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[1..__dollar])) : uint)) does not match any function template declaration C:\Projects\ae\net\http\server.d(93): Error: template std.algorithm.startsWith(alias pred = "a == b",Range,Ranges...) if (isInputRange!(Range) && Ranges.length > 1 && is(t ypeof(.startsWith!(pred)(doesThisStart,withOneOfThese[0])) : bool) && is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[1..__dollar])) : uint)) cannot deduce templ ate function from argument types !()(string,string) C:\Soft\dmd2d\src\phobos\std\string.d(538): Error: expression isSomeChar!(char) of type void does not have a boolean value C:\Projects\ae\net\http\server.d(98): Error: template std.string.indexOf(Char) if (isSomeChar!(Char)) does not match any function template declaration C:\Projects\ae\net\http\server.d(98): Error: template std.string.indexOf(Char) if (isSomeChar!(Char)) cannot deduce template function from argument types !()(string,string ) C:\Soft\dmd2d\src\phobos\std\conv.d(253): Error: constraint isImplicitlyConvertible!(string,uint) is not constant or does not evaluate to a bool C:\Soft\dmd2d\src\phobos\std\conv.d(358): Error: constraint isStaticArray!(string) is not constant or does not evaluate to a bool C:\Soft\dmd2d\src\phobos\std\conv.d(450): Error: expression isImplicitlyConvertible!(string,uint) of type void does not have a boolean value C:\Soft\dmd2d\src\phobos\std\conv.d(500): Error: expression isImplicitlyConvertible!(string,uint) of type void does not have a boolean value C:\Soft\dmd2d\src\phobos\std\conv.d(572): Error: expression isImplicitlyConvertible!(string,uint) of type void does not have a boolean value ( ... 962 lines omitted ... ) I can't reproduce this right now, but should I try to reduce this problem if I encounter it again, or is this a known bug? I remember seeing this issue a long time ago, but not recently - until a few days ago. So I think it was triggered by the "soldier on" change, like this bug.
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/36e214a3789c11d4102e53b63bf0f5283b0c6b67 fix Issue 7557 - Sea of errors after template failure
https://github.com/D-Programming-Language/dmd/pull/755
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル