D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2227 - Error forbidding a function template instantiation is not reported
Summary: Error forbidding a function template instantiation is not reported
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 regression
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2008-07-15 06:46 UTC by Max Samukha
Modified: 2015-06-09 01:19 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 Max Samukha 2008-07-15 06:46:28 UTC
template Bar(T)
{
    alias typeof(T.ini) Bar; // an error hidden deep in a nested template;
}

template Foo(T)
{
    alias Bar!(T) Foo;
}

void foo(T)(Foo!(T) x)
{
}

void main()
{
    foo!(int)(2);
}
----
test.d(19): template test.foo(T) does not match any function template declaration
test.d(19): template test.foo(T) cannot deduce template function from argument types !(int)(int)


D 1.0 reports the error in Bar as expected:
test.d(5): Error: no property 'ini' for type 'int'
test.d(10): template instance test.Bar!(int) error instantiating
Comment 1 Max Samukha 2008-07-16 02:38:42 UTC
Raising the severity because this issue considerably complicates the debugging of templates
Comment 2 Don 2010-05-06 12:47:07 UTC
Fixed DMD 2.038.