Skip to content

Commit 3c39f3e

Browse files
committed
type stability fix for sourcetext
Changing `SubString` to the concrete `SubString{String}` should make Julia's sysimage more resistant to invalidation, once this change propagates to Julia proper.
1 parent 012d931 commit 3c39f3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/parse_stream.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ function sourcetext(stream::ParseStream; steal_textbuf=false)
917917
# unstable. (Also codeunit(root) == UInt8 doesn't imply UTF-8 encoding?)
918918
# if root isa AbstractString && codeunit(root) == UInt8
919919
# return root
920-
str = if root isa String || root isa SubString
920+
str = if root isa String || root isa SubString{String}
921921
root
922922
elseif steal_textbuf
923923
String(stream.textbuf)

0 commit comments

Comments
 (0)