-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Create @__FUNCTION__ and Expr(:thisfunction) as generic function self-reference
#58940
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
Merged
JeffBezanson
merged 47 commits into
JuliaLang:master
from
MilesCranmer:thisfunction-expr
Jul 18, 2025
Merged
Changes from 14 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
8a4e772
feat: enable `var"#self#"` for callable structs
MilesCranmer e72edfc
add tests for `var"#self#"` in callable structs
MilesCranmer 048f6fa
Merge branch 'master' into callable-struct-self
MilesCranmer 41c31b5
Update src/julia-syntax.scm
MilesCranmer e1f2cf3
remove redundant `and`
MilesCranmer db24816
create `Expr(:thisfunction) -> var"#self#"`
MilesCranmer 23e7678
change tests to use `Expr(:thisfunction)`
MilesCranmer b0da142
fix inclusion
MilesCranmer 50afcde
ensure we also check for (thisfunction) when referencing
MilesCranmer bd7f004
simplify Expr(:thisfunction) processing
MilesCranmer f116edd
example approach to kw compat for :thisfunction
MilesCranmer e503d3a
fix callable struct error
MilesCranmer d6adc73
handle ctor-self
MilesCranmer 8495ca9
fix edge cases of :thisfunction parsing
MilesCranmer dbb1f7b
Update src/julia-syntax.scm
MilesCranmer d01c30b
remove incorrect effect for thisfunction
MilesCranmer da85566
use expr-contains-p
MilesCranmer 6f355ad
simplify parts of thisfunction expansion
MilesCranmer 5509f6c
simplify final-name and use it
MilesCranmer 8ab267a
handle non-symbol argname
MilesCranmer e753709
unneccessary comment
MilesCranmer 68c1987
fix slot idx error with explicit variable name
MilesCranmer b1f858f
make sure we gen the #self#
MilesCranmer 56632e5
put back argmap as required for kwcall
MilesCranmer 8f7cca2
improve tests of :thisfunction
MilesCranmer 787320b
Update test/syntax.jl
MilesCranmer 5086df0
fix: disallow `thisfunction` inside comprehension or generator
MilesCranmer 7d883e1
test: add test with generated function example
MilesCranmer aec2984
add `@__FUNCTION__` macro from https://github.com/JuliaLang/julia/pul…
MilesCranmer a3965bc
update error test
MilesCranmer 8433123
move tests to syntax.jl
MilesCranmer 53f3515
thisfunction error should refer to macro
MilesCranmer fde0e61
add test against comprehension
MilesCranmer 480f44d
kw test broken for some reason
MilesCranmer d9b6164
Update src/julia-syntax.scm
MilesCranmer 452aac0
avoid globalref in `thisfunction` reference as not needed
MilesCranmer dbfeae2
fix: remove added line
MilesCranmer 1f89559
add jeff's edge cases to tests
MilesCranmer 28f74f0
fixes
JeffBezanson 0577319
tests no longer broken
MilesCranmer 8636f11
fix eval block
MilesCranmer 337a593
prevent name collisions in test
MilesCranmer 02a5759
Merge branch 'master' into thisfunction-expr
MilesCranmer 49bf1fe
update Meta.lower test for new error message
MilesCranmer 23caad0
tighten up docstring
MilesCranmer 9f3bdb5
refer to macro in misuse error message
MilesCranmer f49718e
tweak NEWS
MilesCranmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.