Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if a method of
lockgets defined and a method instance gets compiled/inferred before you changemax_methodshere? Would it cause miscompilation?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From grepping the code and looking at the include order in
Base.jlI think this is where the function is declared the first time, so that should not happen.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if some other PR switches the code around a bit, sometime in the future? Will we get miscompilation silently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a separate concern from this PR since this code pattern is already used in other places already. Maybe move the discussion to a separate issue?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is a separate issue. The pattern of modifying
max_methodsfor a function is only used for a few examples currently:copyto!mergeerror(PR merge the three methods oferrorinto a single method #60878 attempts to prevent that)So if it becomes common to modify
max_methodsfor various functions all over the code base, I think then we would actually need to start worrying about stuff like this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, since it is already in the code base, a dedicated issue makes more sense rather than comments on a PR.