Skip to content
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

Support begin and end in gen_call_with_extracted_types users #45968

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

ianatol
Copy link
Member

@ianatol ianatol commented Jul 8, 2022

Fixes #45428 #37379 JuliaDebug/Cthulhu.jl#291

Locally passes relevant tests (Base.runtests("InteractiveUtils show reflection staged"), but its a pretty naive approach so would like to see results of CI and get further comments. Seems to generally fix what its supposed to though:

Before:

julia> a = [1,2]; @which a[1:end]
ERROR: UndefVarError: end not defined
Stacktrace:
 [1] top-level scope
   @ REPL[25]:1

julia> @code_typed a[1:end]
ERROR: UndefVarError: end not defined
Stacktrace:
 [1] top-level scope

After:

julia> a = [1,2]; @which a[1:end]
getindex(A::Array, I::AbstractUnitRange{<:Integer})
     @ Base array.jl:921

julia> @code_typed a[1:end]
CodeInfo(
1 ─       goto #6 if not $(Expr(:boundscheck))
2%2  = Core.tuple(I)::Tuple{UnitRange{Int64}}
[snip...]
) => Vector{Int64}

@inkydragon inkydragon added macros @macros stdlib Julia's standard library labels Jul 10, 2022
Copy link
Sponsor Member

@aviatesk aviatesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add test cases too?

@ianatol
Copy link
Member Author

ianatol commented Jul 13, 2022

Added some basic tests

@ianatol ianatol force-pushed the utilsbeginend branch 2 times, most recently from 1d5a1d4 to 7228767 Compare July 18, 2022 17:52
@ianatol ianatol force-pushed the utilsbeginend branch 5 times, most recently from 90ae027 to 5fca444 Compare July 28, 2022 23:40
stdlib/InteractiveUtils/test/runtests.jl Outdated Show resolved Hide resolved
@aviatesk aviatesk added the merge me PR is reviewed. Merge when all tests are passing label Jul 28, 2022
@aviatesk aviatesk merged commit 8fe9d93 into JuliaLang:master Jul 29, 2022
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Aug 1, 2022
ffucci pushed a commit to ffucci/julia that referenced this pull request Aug 11, 2022
pcjentsch pushed a commit to pcjentsch/julia that referenced this pull request Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macros @macros stdlib Julia's standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@code_typed and family don't lower begin and end in indexing operations
5 participants