Skip to content

Commit 8dd71bc

Browse files
committed
add missing @nospecialize annotations
1 parent 2576d56 commit 8dd71bc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/signatures.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ end
426426
function get_running_name(@nospecialize(recurse), frame, pc, name, parentname)
427427
nameinfo = find_name_caller_sig(recurse, frame, pc, name, parentname)
428428
if nameinfo === nothing
429-
pc = skip_until(stmt->isexpr(stmt, :method, 3), frame, pc)
429+
pc = skip_until(@nospecialize(stmt)->isexpr(stmt, :method, 3), frame, pc)
430430
pc = next_or_nothing(frame, pc)
431431
return name, pc, nothing
432432
end

test/codeedges.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using LoweredCodeUtils: callee_matches, istypedef, exclude_named_typedefs
66
using JuliaInterpreter: is_global_ref, is_quotenode
77
using Test
88

9-
function hastrackedexpr(stmt; heads=LoweredCodeUtils.trackedheads)
9+
function hastrackedexpr(@nospecialize(stmt); heads=LoweredCodeUtils.trackedheads)
1010
haseval = false
1111
if isa(stmt, Expr)
1212
if stmt.head === :call
@@ -241,7 +241,7 @@ module ModSelective end
241241
frame = Frame(ModSelective, ex)
242242
src = frame.framecode.src
243243
edges = CodeEdges(ModSelective, src)
244-
isrequired = minimal_evaluation(stmt->(LoweredCodeUtils.ismethod_with_name(src, stmt, "NoParam"),false), src, edges) # initially mark only the constructor
244+
isrequired = minimal_evaluation(@nospecialize(stmt)->(LoweredCodeUtils.ismethod_with_name(src, stmt, "NoParam"),false), src, edges) # initially mark only the constructor
245245
selective_eval_fromstart!(frame, isrequired, true)
246246
@test isa(ModSelective.NoParam(), ModSelective.NoParam)
247247
# Parametric
@@ -253,7 +253,7 @@ module ModSelective end
253253
frame = Frame(ModSelective, ex)
254254
src = frame.framecode.src
255255
edges = CodeEdges(ModSelective, src)
256-
isrequired = minimal_evaluation(stmt->(LoweredCodeUtils.ismethod_with_name(src, stmt, "Struct"),false), src, edges) # initially mark only the constructor
256+
isrequired = minimal_evaluation(@nospecialize(stmt)->(LoweredCodeUtils.ismethod_with_name(src, stmt, "Struct"),false), src, edges) # initially mark only the constructor
257257
selective_eval_fromstart!(frame, isrequired, true)
258258
@test isa(ModSelective.Struct([1,2,3]), ModSelective.Struct{Int})
259259
# Keyword constructor (this generates :copyast expressions)
@@ -270,7 +270,7 @@ module ModSelective end
270270
frame = Frame(ModSelective, ex)
271271
src = frame.framecode.src
272272
edges = CodeEdges(ModSelective, src)
273-
isrequired = minimal_evaluation(stmt->(LoweredCodeUtils.ismethod3(stmt),false), src, edges) # initially mark only the constructor
273+
isrequired = minimal_evaluation(@nospecialize(stmt)->(LoweredCodeUtils.ismethod3(stmt),false), src, edges) # initially mark only the constructor
274274
selective_eval_fromstart!(frame, isrequired, true)
275275
kws = ModSelective.KWStruct(y=5.0f0)
276276
@test kws.y === 5.0f0
@@ -302,7 +302,7 @@ module ModSelective end
302302
frame = Frame(ModEval, ex)
303303
src = frame.framecode.src
304304
edges = CodeEdges(ModEval, src)
305-
isrequired = minimal_evaluation(stmt->(LoweredCodeUtils.ismethod3(stmt),false), src, edges; norequire=exclude_named_typedefs(src, edges)) # initially mark only the constructor
305+
isrequired = minimal_evaluation(@nospecialize(stmt)->(LoweredCodeUtils.ismethod3(stmt),false), src, edges; norequire=exclude_named_typedefs(src, edges)) # initially mark only the constructor
306306
bbs = Core.Compiler.compute_basic_blocks(src.code)
307307
for (iblock, block) in enumerate(bbs.blocks)
308308
r = LoweredCodeUtils.rng(block)
@@ -339,9 +339,9 @@ module ModSelective end
339339
end)
340340
src = thk.args[1]
341341
edges = CodeEdges(Main, src)
342-
idx = findfirst(stmt->Meta.isexpr(stmt, :method), src.code)
342+
idx = findfirst(@nospecialize(stmt)->Meta.isexpr(stmt, :method), src.code)
343343
lr = lines_required(idx, src, edges; norequire=exclude_named_typedefs(src, edges))
344-
idx = findfirst(stmt->Meta.isexpr(stmt, :(=)) && Meta.isexpr(stmt.args[2], :call) && is_global_ref(stmt.args[2].args[1], Core, :Box), src.code)
344+
idx = findfirst(@nospecialize(stmt)->Meta.isexpr(stmt, :(=)) && Meta.isexpr(stmt.args[2], :call) && is_global_ref(stmt.args[2].args[1], Core, :Box), src.code)
345345
@test lr[idx]
346346
# but make sure we don't break primitivetype & abstracttype (https://github.com/timholy/Revise.jl/pull/611)
347347
if isdefined(Core, :_primitivetype)

0 commit comments

Comments
 (0)