Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
October 27, 2017 [Issue 17941] arity (and probably others) only consider the first lexically present function | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17941 Ketmar Dark <ketmar@ketmar.no-ip.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ketmar@ketmar.no-ip.org -- |
October 27, 2017 [Issue 17941] arity (and probably others) only consider the first lexically present function | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17941 Simen Kjaeraas <simen.kjaras@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simen.kjaras@gmail.com --- Comment #1 from Simen Kjaeraas <simen.kjaras@gmail.com> --- This happens for all templates in std.traits that deal with properties of functions. Making the templates fail when presented with an under-specified overload set would be a breaking change, but documenting the behavior is definitely worth it. Phobos currently does not have good tools for working with overload sets - __traits(getOverloads) is what we've got, and finding a specific overload is manual work. In order to fix that part of the problem, I've created getOverloads and overloadFor: https://github.com/dlang/phobos/pull/5818 -- |
January 28, 2018 [Issue 17941] arity (and probably others) only consider the first lexically present function | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17941 Simen Kjaeraas <simen.kjaras@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dechcaudron+dlang.issue.tra | |cking@protonmail.com --- Comment #2 from Simen Kjaeraas <simen.kjaras@gmail.com> --- *** Issue 18314 has been marked as a duplicate of this issue. *** -- |
January 28, 2018 [Issue 17941] arity (and probably others) only consider the first lexically present function | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17941 --- Comment #3 from dechcaudron+dlang.issue.tracking@protonmail.com --- > a real solution would allow people to indicate which overload they're interested in Maybe allow something of the sort static assert(arity!fun(int) == 1); static assert(arity!gun(int, int) == 2); ? I had reported this as a Phobos issue (see above), but since it has been marked as a duplicate for a dmd one, there's not much I can do. Compiler stuff is still magic to me, I'm afraid. -- |
January 28, 2018 [Issue 17941] arity (and probably others) only consider the first lexically present function | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17941 Simen Kjaeraas <simen.kjaras@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|dmd |phobos OS|Linux |All --- Comment #4 from Simen Kjaeraas <simen.kjaras@gmail.com> --- (In reply to dechcaudron+dlang.issue.tracking from comment #3) > Maybe allow something of the sort > > static assert(arity!fun(int) == 1); > static assert(arity!gun(int, int) == 2); arity is an interesting case here, since it's hard to get the correct overload without knowing the arity already. :p The PR mentioned above would get the correct arity this way: static assert(arity!(overloadFor!(fun, int)) == 1); static assert(arity!(overloadFor!(gun, int, int)) == 2); > I had reported this as a Phobos issue (see above), but since it has been marked as a duplicate for a dmd one, there's not much I can do. Compiler stuff is still magic to me, I'm afraid. Fixing the issue in DMD would break a *lot* of code, and so isn't really feasible. I'm pretty sure it's not really desirable either, since the new semantics would be at least as weird as what we have. You could say the root issue is in DMD - templates operate on the first element when passed an overload set. The problem can however be ameliorated in Phobos, by giving programmers a way to specify which overload they mean. -- |
December 17, 2022 [Issue 17941] arity (and probably others) only consider the first lexically present function | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17941 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P4 -- |
December 01 [Issue 17941] arity (and probably others) only consider the first lexically present function | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17941 --- Comment #5 from dlangBugzillaToGithub <robert.schadek@posteo.de> --- THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10268 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB -- |
Copyright © 1999-2021 by the D Language Foundation