October 15, 2019 [Issue 20298] Passing field alias to alias predicate doesn't work, predicate needs explicit instantiation | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20298 RazvanN <razvan.nitu1305@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |razvan.nitu1305@gmail.com --- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> --- Isn't the real bug here the fact that calling ipred passes compilation? As far as I could tell the lambda template instantion is inside the scope of the S struct => you cannot call it from fun, since fun may call only const functions and pred is mutable. -- |
October 15, 2019 [Issue 20298] Passing field alias to alias predicate doesn't work, predicate needs explicit instantiation | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20298 --- Comment #2 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> --- Thanks for looking at this! (In reply to RazvanN from comment #1) > As > far as I could tell the lambda template instantion is inside the scope of > the S struct Hmm! But, shouldn't it infer that since it doesn't access anything other than its arguments, it should not have a context? I see that ipred is typed as a function not delegate. > you cannot call it from fun, since fun may call only const functions and pred is mutable. Thanks, I actually didn't realize that fun being const was a crucial part of this. I guess the error message could be better. -- |
Copyright © 1999-2021 by the D Language Foundation