8237 – Error message with _error_ when using failed type inference in template parameter

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8237 - Error message with _error_ when using failed type inference in template parameter
Summary: Error message with _error_ when using failed type inference in template param...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
Reported: 2012年06月14日 02:49 UTC by Don
Modified: 2015年06月09日 05:10 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2012年06月14日 02:49:29 UTC
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.
Comment 2 github-bugzilla 2012年06月20日 13:03:00 UTC
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
Merge pull request #1016 from donc/ctfeEntry
Stop running CTFE on symbols, + fix bug 8237


AltStyle によって変換されたページ (->オリジナル) /