Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,10 @@ const undef = UndefInitializer()
# empty vector constructor
(self::Type{GenericMemory{kind,T,addrspace}})() where {T,kind,addrspace} = self(undef, 0)

memoryref(mem::GenericMemory) = memoryrefnew(mem)
memoryref(@nospecialize(mem::GenericMemory)) = memoryrefnew(mem)
memoryref(mem::GenericMemory, i::Integer) = memoryrefnew(memoryrefnew(mem), Int(i), @_boundscheck)
memoryref(ref::GenericMemoryRef, i::Integer) = memoryrefnew(ref, Int(i), @_boundscheck)
GenericMemoryRef(mem::GenericMemory) = memoryref(mem)
GenericMemoryRef(@nospecialize(mem::GenericMemory)) = memoryref(mem)
GenericMemoryRef(mem::GenericMemory, i::Integer) = memoryref(mem, i)
GenericMemoryRef(mem::GenericMemoryRef, i::Integer) = memoryref(mem, i)

Expand Down
1 change: 1 addition & 0 deletions base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,7 @@ end
# Specialized variant of in for Tuple, which can generate typed comparisons for each element
# of the tuple, skipping values that are statically known to be != at compile time.
in(x, itr::Tuple) = _in_tuple(x, itr, false)

# This recursive function will be unrolled at compiletime, and will not generate separate
# llvm-compiled specializations for each step of the recursion.
function _in_tuple(x, @nospecialize(itr::Tuple), anymissing::Bool)
Expand Down
4 changes: 2 additions & 2 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function show(io::IO, ::MIME"text/plain", t::AbstractDict{K,V}) where {K,V}
rows -= 1 # Subtract the summary

# determine max key width to align the output, caching the strings
hascolor = get(recur_io, :color, false)
hascolor = get(recur_io, :color, false)::Bool
ks = Vector{String}(undef, min(rows, length(t)))
vs = Vector{String}(undef, min(rows, length(t)))
keywidth = 0
Expand Down Expand Up @@ -2003,7 +2003,7 @@ function show_unquoted_expr_fallback(io::IO, ex::Expr, indent::Int, quote_level:
end

# TODO: implement interpolated strings
function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int, quote_level::Int = 0)
@nospecializeinfer function show_unquoted(@nospecialize(io::IO), ex::Expr, indent::Int, prec::Int, quote_level::Int = 0)
head, args, nargs = ex.head, ex.args, length(ex.args)
unhandled = false
# dot (i.e. "x.y"), but not compact broadcast exps
Expand Down
12 changes: 10 additions & 2 deletions base/tuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ _counttuple(::Type) = nothing

## indexing ##

function firstindex(@nospecialize t::Tuple)
@_nospecializeinfer_meta
1
end

length(@nospecialize t::Tuple) = nfields(t)
firstindex(@nospecialize t::Tuple) = 1
lastindex(@nospecialize t::Tuple) = length(t)
size(@nospecialize(t::Tuple), d::Integer) = (d == 1) ? length(t) : throw(ArgumentError("invalid tuple dimension $d"))
axes(@nospecialize t::Tuple) = (OneTo(length(t)),)
Expand Down Expand Up @@ -640,7 +644,11 @@ end
## functions ##

isempty(x::Tuple{}) = true
isempty(@nospecialize x::Tuple) = false

function isempty(@nospecialize x::Tuple)
@_nospecializeinfer_meta
false
end

revargs() = ()
revargs(x, r...) = (revargs(r...)..., x)
Expand Down