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

--- Comment #0 from Don <> 2012-06-14 02:49:29 PDT ---
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:
------- You are receiving this mail because: -------

Reply via email to