Bug 10924 – covariant attribute inference for all functions

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-30T00:15:01Z
Last change time
2024-12-13T18:10:59Z
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#18660 →

Comments

Comment #0 by code — 2013-08-30T00:15:01Z
The main reason why we can't perform attribute inference for all functions is separate compilation. Currently we only do it for functions where the source code must be available, i.e. template functions and auto return functions. If we added an alias symbol from the mangling with annotated attributes to the one with inferred attributes an object could be linked with or without knowledge of the infered attributes/source code. This could be helpful to reduce the amount of annotation necessary within a library/project.
Comment #1 by reachzach — 2015-01-08T04:22:43Z
See my argument in favor of this enhancement here: http://forum.dlang.org/thread/[email protected] My suggested alternative to generating two links for each function is to introduce a linkage attribute (suggested names: "@api", "extern(noinfer)") to tell the compiler to mangle and generate .di signatures without the inferred attributes. I'm having trouble understanding why fully inferred attributes are meeting so much resistance here: https://github.com/D-Programming-Language/dmd/pull/1877 Related issues: https://issues.dlang.org/show_bug.cgi?id=9914 https://issues.dlang.org/show_bug.cgi?id=13567
Comment #2 by robert.schadek — 2024-12-13T18:10:59Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18660 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB