Bug 2782 – Parameter Names Should Be Visible In Function Template Constraints
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-04-01T20:48:00Z
Last change time
2015-06-09T01:19:51Z
Keywords
rejects-valid
Assigned to
nobody
Creator
dsimcha
Comments
Comment #0 by dsimcha — 2009-04-01T20:48:28Z
void doStuff(T)(T arg)
if(is(typeof(arg))) {
}
void main() {
doStuff(1);
}
Results:
test7.d|6|template test7.doStuff(T) if (is(typeof(arg))) does not match any
function template declaration|
test7.d|6|template test7.doStuff(T) if (is(typeof(arg))) cannot deduce
template function from argument types !()(int)
I assume the reason this does not compile is because the symbol arg is not visible from the template constraint.