Skip to content

Commit b4d133d

Browse files
authored
1 parent 9026819 commit b4d133d

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/optimize.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -372,19 +372,19 @@ end
372372
function replace_coretypes_list!(list::AbstractVector; rev::Bool)
373373
function rep(@nospecialize(x), rev::Bool)
374374
if rev
375-
if isa(x, SSAValue)
376-
return Core.SSAValue(x.id)
377-
elseif isa(x, SlotNumber)
378-
return Core.SlotNumber(x.id)
375+
isa(x, SSAValue) && return Core.SSAValue(x.id)
376+
isa(x, SlotNumber) && return Core.SlotNumber(x.id)
377+
return x
378+
else
379+
isa(x, Core.SSAValue) && return SSAValue(x.id)
380+
isa(x, Core.SlotNumber) && return SlotNumber(x.id)
381+
@static if VERSION v"1.10.0-DEV.631"
382+
isa(x, Core.TypedSlot) && return SlotNumber(x.id)
383+
else
384+
isa(x, Core.Compiler.TypedSlot) && return SlotNumber(x.id)
379385
end
380386
return x
381387
end
382-
if isa(x, Core.SSAValue)
383-
return SSAValue(x.id)
384-
elseif isa(x, Core.SlotNumber) || isa(x, Core.TypedSlot)
385-
return SlotNumber(x.id)
386-
end
387-
return x
388388
end
389389

390390
for (i, stmt) in enumerate(list)

test/interpret.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ let TT = Union{UInt8, Int8}
307307
end
308308

309309
# issue #92
310-
let x = Core.TypedSlot(1, Any)
310+
let x = Core.SlotNumber(1)
311311
f(x) = objectid(x)
312312
@test isa(@interpret(f(x)), UInt)
313313
end

0 commit comments

Comments
 (0)