Bug 7913 – Strange triggering of irrelevant compilation errors
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-14T16:28:00Z
Last change time
2013-11-26T20:01:04Z
Assigned to
nobody
Creator
marcianx
Comments
Comment #0 by marcianx — 2012-04-14T16:28:16Z
This is with the linux (openSUSE) DMD64 v2.059.
Here is the code of interest.
----------
import std.stdio;
void println(int i) { writeln(i); } // Bug trigger #1
void main()
{
// methods of Exception
auto b = [ __traits(allMembers, Exception) ];
writeln(b); // Bug trigger #2
asdf; // Bug trigger #3 (intentional compilation error)
}
----------
If Bug trigger #3 is commented, then it compiles without output (as
expected) with
----------
$ dmd unexpected_error_messages.d
----------
If I comment out EITHER Bug trigger #1 or #2 then I receive the expected
compilation error
----------
unexpected_error_messages.d(12): Error: undefined identifier asdf
----------
If the code is compiled as-is, then I get this confusing mess of errors, the
latter of which seems completely irrelevant in this context. This might be
triggered by a bug.
----------
unexpected_error_messages.d(12): Error: undefined identifier asdf
/usr/include/d/dmd/phobos/std/conv.d(244): Error: template std.conv.toImpl does not match any function template declaration
/usr/include/d/dmd/phobos/std/conv.d(244): Error: template std.conv.toImpl cannot deduce template function from argument types !(string)(ubyte)
/usr/include/d/dmd/phobos/std/conv.d(244): Error: template instance toImpl!(string) errors instantiating template
/usr/include/d/dmd/phobos/std/conv.d(3034): Error: template instance std.conv.to!(string).to!(ubyte) error instantiating
/usr/include/d/dmd/phobos/std/conv.d(3016): instantiated from here: textImpl!(string,string,void*,string,int,string,int,string,char,string,ubyte,string,ubyte,string,bool,string,bool,string,bool,string,bool,string,bool,string,const(char)[],string,const(char)[],string)
/usr/include/d/dmd/phobos/std/format.d(1078): instantiated from here: text!(string,void*,string,int,string,int,string,char,string,ubyte,string,ubyte,string,bool,string,bool,string,bool,string,bool,string,bool,string,const(char)[],string,const(char)[],string)
/usr/include/d/dmd/phobos/std/format.d(392): instantiated from here: FormatSpec!(char)
/usr/include/d/dmd/phobos/std/stdio.d(687): ... (1 instantiations, -v to show) ...
/usr/include/d/dmd/phobos/std/stdio.d(1574): instantiated from here: write!(string[],char)
unexpected_error_messages.d(10): instantiated from here: writeln!(string[])
/usr/include/d/dmd/phobos/std/conv.d(3016): Error: template instance std.conv.textImpl!(string,string,void*,string,int,string,int,string,char,string,ubyte,string,ubyte,string,bool,string,bool,string,bool,string,bool,string,bool,string,const(char)[],string,const(char)[],string) error instantiating
/usr/include/d/dmd/phobos/std/format.d(1078): instantiated from here: text!(string,void*,string,int,string,int,string,char,string,ubyte,string,ubyte,string,bool,string,bool,string,bool,string,bool,string,bool,string,const(char)[],string,const(char)[],string)
/usr/include/d/dmd/phobos/std/format.d(392): instantiated from here: FormatSpec!(char)
/usr/include/d/dmd/phobos/std/stdio.d(687): instantiated from here: formattedWrite!(LockingTextWriter,char,string[])
/usr/include/d/dmd/phobos/std/stdio.d(1574): instantiated from here: write!(string[],char)
unexpected_error_messages.d(10): instantiated from here: writeln!(string[])
/usr/include/d/dmd/phobos/std/format.d(1078): Error: template instance std.conv.text!(string,void*,string,int,string,int,string,char,string,ubyte,string,ubyte,string,bool,string,bool,string,bool,string,bool,string,bool,string,const(char)[],string,const(char)[],string) error instantiating
/usr/include/d/dmd/phobos/std/format.d(392): instantiated from here: FormatSpec!(char)
/usr/include/d/dmd/phobos/std/stdio.d(687): instantiated from here: formattedWrite!(LockingTextWriter,char,string[])
/usr/include/d/dmd/phobos/std/stdio.d(1574): instantiated from here: write!(string[],char)
unexpected_error_messages.d(10): instantiated from here: writeln!(string[])
----------