Comment #0 by ilyayaroshenko — 2014-11-18T00:39:32Z
void foo(T)(T i)
{
if(i)
bar(--i);
}
void bar(T)(T i)
{
foo(i);
}
@safe unittest
{
foo(10u);
}
========
test6_2.d(13): Error: safe function 'test6_2.__unittestL11_1' cannot call system function 'test6_2.foo!uint.foo'
Comment #1 by hsteoh — 2014-11-18T00:53:19Z
Just wanted to add, that while this test case may look artificial, it reflects actual usage in Phobos where you may have one generic function instantiated in such a way that further down the road it gets re-instantiated. Such chains of dependencies are often buried deep within Phobos modules implicitly, due to the generic nature of most of Phobos modules, so this is a real, practical problem.