REPL: fix #27184, ensure macro existence before lowering#40621
Merged
simeonschaub merged 1 commit intoJuliaLang:masterfrom Apr 28, 2021
Merged
REPL: fix #27184, ensure macro existence before lowering#40621simeonschaub merged 1 commit intoJuliaLang:masterfrom
simeonschaub merged 1 commit intoJuliaLang:masterfrom
Conversation
aviatesk
commented
Apr 27, 2021
| end | ||
| get_value(sym::Symbol, fn) = isdefined(fn, sym) ? (getfield(fn, sym), true) : (nothing, false) | ||
| get_value(sym::QuoteNode, fn) = isdefined(fn, sym.value) ? (getfield(fn, sym.value), true) : (nothing, false) | ||
| get_value(sym::GlobalRef, fn) = get_value(sym.name, sym.mod) |
Member
Author
There was a problem hiding this comment.
I added this method because Core.@cmd macro will be lowered with GlobalRef, but this one looks a bit weird since it totally ignores the context fn.
Maybe special-casing it inside isexpr(sym, :macrocall) block within get_type looks better ?
Member
There was a problem hiding this comment.
This seems like the correct thing to do to me. Of course, we would expect all GlobalRefs emitted by the parser to actually exist, but I don't think being more defensive here hurts.
Member
Author
There was a problem hiding this comment.
okay, then I will leave this as is.
simeonschaub
approved these changes
Apr 27, 2021
ElOceanografo
pushed a commit
to ElOceanografo/julia
that referenced
this pull request
May 4, 2021
jarlebring
pushed a commit
to jarlebring/julia
that referenced
this pull request
May 4, 2021
antoine-levitt
pushed a commit
to antoine-levitt/julia
that referenced
this pull request
May 9, 2021
johanmon
pushed a commit
to johanmon/julia
that referenced
this pull request
Jul 5, 2021
66 tasks
KristofferC
pushed a commit
that referenced
this pull request
Nov 8, 2021
95 tasks
KristofferC
pushed a commit
that referenced
this pull request
Nov 11, 2021
KristofferC
pushed a commit
that referenced
this pull request
Nov 12, 2021
This was referenced Dec 24, 2021
staticfloat
pushed a commit
that referenced
this pull request
Dec 23, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.