Skip to content

Commit c5d97f8

Browse files
authored
Base.incomplete_tag: deduplicate code and typeassert (JuliaLang#57984)
The code deduplication should enable `a` to be inferred as `String` in the branch after the `a isa String` check. Also added some `::Symbol` (concrete) typeasserts just in case, because this is recursive code so more demanding for inference. Should improve the resistance to invalidation of the sysimage.
1 parent f211a77 commit c5d97f8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

base/client.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,13 @@ function incomplete_tag(ex::Expr)
223223
return :none
224224
elseif isempty(ex.args)
225225
return :other
226-
elseif ex.args[1] isa String
227-
return fl_incomplete_tag(ex.args[1])
228226
else
229-
return incomplete_tag(ex.args[1])
227+
a = ex.args[1]
228+
if a isa String
229+
return fl_incomplete_tag(a)::Symbol
230+
else
231+
return incomplete_tag(a)::Symbol
232+
end
230233
end
231234
end
232235
incomplete_tag(exc::Meta.ParseError) = incomplete_tag(exc.detail)

0 commit comments

Comments
 (0)