-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix invalidations from novel Integer conversions #36459
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -422,11 +422,11 @@ struct SubstitutionString{T<:AbstractString} <: AbstractString | |
string::T | ||
end | ||
|
||
ncodeunits(s::SubstitutionString) = ncodeunits(s.string) | ||
codeunit(s::SubstitutionString) = codeunit(s.string) | ||
codeunit(s::SubstitutionString, i::Integer) = codeunit(s.string, i) | ||
isvalid(s::SubstitutionString, i::Integer) = isvalid(s.string, i) | ||
iterate(s::SubstitutionString, i::Integer...) = iterate(s.string, i...) | ||
ncodeunits(s::SubstitutionString) = ncodeunits(s.string)::Int | ||
codeunit(s::SubstitutionString) = codeunit(s.string)::Type{<:Union{UInt8, UInt16, UInt32}} | ||
codeunit(s::SubstitutionString, i::Integer) = codeunit(s.string, i)::Union{UInt8, UInt16, UInt32} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure this is true for all string types in practice, but it's not technically required. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docs say this: codeunit(s::AbstractString) -> Type{<:Union{UInt8, UInt16, UInt32}} I've been taking the docs as license to enforce stuff. Should I not? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess someone could have a different code unit, but it would be very weird. Not sure all of the logic in base would work correctly with some other code unit. |
||
isvalid(s::SubstitutionString, i::Integer) = isvalid(s.string, i)::Bool | ||
iterate(s::SubstitutionString, i::Integer...) = iterate(s.string, i...)::Union{Nothing,Tuple{AbstractChar,Int}} | ||
|
||
function show(io::IO, s::SubstitutionString) | ||
print(io, "s") | ||
|
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
Sorry, something went wrong.