-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix issue 72 #73
fix issue 72 #73
Conversation
Codecov ReportBase: 34.05% // Head: 33.57% // Decreases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## master #73 +/- ##
==========================================
- Coverage 34.05% 33.57% -0.49%
==========================================
Files 5 5
Lines 138 140 +2
==========================================
Hits 47 47
- Misses 91 93 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This check was added in #54, see #54 (comment) for motivation. |
Closing in favor of #74 |
Generated functions docs don't make it clear at all what could be used there. |
I agree it is blurry what is allowed in a generated function and what is not.
Language lawyers might argue that |
Yeah, then generated cannot call any other function - they all depend on the method table. |
Technically yes. In practice, this is only a problem if a method used in |
That's exactly the discussion we had in #60 (comment) :) |
I think it was just luck that it had no issues before. It's not that accessing the method table won't ever work in We should avoid adding anything like that in future and be very conservative with changes. This package is widely used basic infrastructure now. |
I still don't see any clear difference on how the method table is accessed: via |
You're arguing from a position of ignorance though, right? That's likely not a good strategy for writing stable code. I'm arguing that we need to be conservative because I don't fully understand everything the compiler does (and don't care to), and because I know that it changes and is allowed to in this situation because of that lack of guarantee on accessing mutable state - which does include the method table. What I'm saying is please don't break half the ecosystem again, and I'm worried you are not becoming more cautious even after this has just happened. |
Agreed.
Yes in retrospect this usage of which was bad. However, this comment seems rather harsh to me.
|
No. I don't argue, but ask you (or anyone else) to explain, please re-read my previous message with a question.
Me neither. Does this mean
AIU, all generated functions are affected by mutable state: they call other functions, reading their methods from the method table. |
Honestly, I review here less because I struggle with this attitude. I don't have time or energy to argue why function are ok but the method table isn't - its a lot of work to understand and convey exactly why that is how things are, and who has time. But we still shouldn't access the method table even if we don't 100% understand, because the docs say not to and we clearly don't know any better. |
But is it? The question of |
@aplavin see here JuliaLang/julia#48611 (comment) |
I usually only do much simpler things in This is a fairly vague heuristic that wont hold up in debate unless being conservative under uncertainty is respected as a rationale. I have a few dodgy old packages that do bad things with generated, but that is noted in the readme. |
OK I found some more details myself. From https://docs.julialang.org/en/v1/manual/metaprogramming/:
This seems to hold in this particular example, but is relevant to another issue with the same code: 8eecb33.
And this is directly relevant - IDK, maybe the worldage issue is due to this generated function loading before vs after propertynames definition?.. But it can also load before/after the definition of a type itself, and this somehow works fine... Hope it will be useful for others as well. |
Exactly with And overwriting |
No description provided.