julia
292562ce - [REPLCompletions] enable aggressive inference for uncached child frames (#51503)

Commit
2 years ago
[REPLCompletions] enable aggressive inference for uncached child frames (#51503) The REPL completion engine employs aggressive inference (incorporating aggressive global binding resolution and aggressive concrete evaluation, ignoring `:consistent`-cy), enabling completions in scenarios such as: ```julia julia> d = Dict{Symbol,Any}(:key => Any[Some(r"x")]) julia> d[:key][1].value.<TAB> compile_options match_options pattern regex ``` While this approach has proven to be quite effective, it has its limitations, given that aggressive inference was only activated for the top-level representing an input code. Therefore, it fails to apply to general cases like: ```julia julia> getkeyelem(d) = d[:key][1] julia> getkeyelem(d).<TAB> # no TAB completion ``` This limitation is the underlying cause of the first part of #51499. To rectify this, the commit implements the following: 1. generalizes aggressive inference to apply to all child frames, when they are not cached. 2. enables aggressive constant propagation, allowing the propagation of mutable Consts. With these changes, now we can get: ```julia julia> getkeyelem(d). # TAB completes julia> getkeyelem(d).value. compile_options match_options pattern regex ``` In conjunction with #51502, this resolves #51499.
Author
Parents
Loading