www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8237] New: Error message with _error_ when using failed type inference in template parameter

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8237

           Summary: Error message with _error_ when using failed type
                    inference in template parameter
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au



template warg(R)
{
    enum bool warg = false;
}

void blarg()
{
    int r = void;
    auto s = r ~ "xxx";
    bool bbb = warg!(typeof(s));
}

bug.d(11): Error: incompatible types for ((r) ~ ("xxx")): 'int' and 'string'
bug.d(12): Error: expression warg!(_error_) is void and has no value

It shouldn't be trying to instantiate the template at all.

Another consequence of this is that CTFE can get called on a ScopeExp, which
doesn't make sense (and the ScopeExp is an invalid template). This happens for
example when compiling std.range with -debug -unittest.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 14 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8237


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/1016

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8237




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/a0976bd34fa140d574e754ff0a6ebfa7d9771d3a
Fix issue 8237 Error message with _error_ when using failed type inference in
template parameter

https://github.com/D-Programming-Language/dmd/commit/eb414991fa87d3f701238bb5109f2d98abcb3855


Stop running CTFE on symbols, + fix bug 8237

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 20 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8237


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 20 2012