[Issue 12542] No function attribute inference for recursive functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 8 01:13:15 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12542



--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2014-04-08 01:13:13 PDT ---
(In reply to comment #0)
> //----
> int logOf(int n)
> {
>     if (n)
>         return 1 + logOf(n/2);
>     return 0;
> }
> 
> void main() @safe nothrow pure 
> {
>     int log = logOf(9);
> }

For attribute inference, logOf should be template function.

https://github.com/D-Programming-Language/dmd/pull/3436

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list