Bug 15981 – infer function types for auto functions

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-05-01T23:59:13Z
Last change time
2022-11-07T10:58:03Z
Assigned to
No Owner
Creator
Seb

Comments

Comment #0 by greensunny12 — 2016-05-01T23:59:13Z
> Why didn't we go with all functions being able to infer const, pure etc rather than just templates? The problem is essentially untractable when there are loops in the call graph. That being said, it would make sense to do it for auto functions. (discussion: http://forum.dlang.org/post/[email protected]) I just put this here, so it doesn't get forgotten ;-)
Comment #1 by razvan.nitu1305 — 2022-11-07T10:58:03Z
This has been fixed: ``` auto fun() {} pragma(msg, typeof(&fun)); ``` yields: void function() pure nothrow @nogc @safe