Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

covariant attribute inference for all functions #18660

Open
dlangBugzillaToGithub opened this issue Aug 30, 2013 · 1 comment
Open

covariant attribute inference for all functions #18660

dlangBugzillaToGithub opened this issue Aug 30, 2013 · 1 comment

Comments

@dlangBugzillaToGithub
Copy link

Martin Nowak (@MartinNowak) reported this on 2013-08-30T00:15:01Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=10924

CC List

  • Zach the Mystic

Description

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.
@dlangBugzillaToGithub
Copy link
Author

reachzach commented on 2015-01-08T04:22:43Z

See my argument in favor of this enhancement here:

http://forum.dlang.org/thread/vlzwhhymkjgckgyoxlrq@forum.dlang.org

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant