D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7913 - Strange triggering of irrelevant compilation errors
Summary: Strange triggering of irrelevant compilation errors
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-14 16:28 UTC by marcianx
Modified: 2013-11-26 20:01 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description marcianx 2012-04-14 16:28:16 UTC
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[])
----------