From 9d6716a2607bf5b8b5b445f4a9c907d01d6e0cc0 Mon Sep 17 00:00:00 2001 From: KDr2 Date: Tue, 22 Oct 2024 08:59:27 +0800 Subject: [PATCH] remove TypedSlot --- .github/workflows/Testing.yaml | 1 + src/Libtask.jl | 6 +++++- src/tapedfunction.jl | 8 +++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Testing.yaml b/.github/workflows/Testing.yaml index 48d03b62..224c879e 100644 --- a/.github/workflows/Testing.yaml +++ b/.github/workflows/Testing.yaml @@ -13,6 +13,7 @@ jobs: version: - '1.7' - '1' + - '1.11.1' - 'nightly' os: - ubuntu-latest diff --git a/src/Libtask.jl b/src/Libtask.jl index 6f6985c7..f31f37be 100644 --- a/src/Libtask.jl +++ b/src/Libtask.jl @@ -11,7 +11,11 @@ export TArray, tzeros, tfill, TRef # legacy types back compat const TypedSlot = @static if isdefined(Core, :TypedSlot) # Julia v1.10 removed Core.TypedSlot Core.TypedSlot else - Core.Compiler.TypedSlot + if isdefined(Core.Compiler, :TypedSlot) # Julia 1.11 removed Core.Compiler.TypedSlot + Core.Compiler.TypedSlot + else + Any + end end include("tapedfunction.jl") diff --git a/src/tapedfunction.jl b/src/tapedfunction.jl index e5eeef22..e36e650f 100644 --- a/src/tapedfunction.jl +++ b/src/tapedfunction.jl @@ -285,9 +285,11 @@ function bind_var!(var::QuoteNode, bindings::Bindings, ir::Core.CodeInfo) LOGGING[] && @info "evaluating QuoteNode $var at compile time" bind_var!(eval(var), bindings, ir) end -function bind_var!(var::TypedSlot, bindings::Bindings, ir::Core.CodeInfo) - # turn TypedSlot to SlotNumber - bind_var!(Core.SlotNumber(var.id), bindings, ir) +@static if TypedSlot !== Any + function bind_var!(var::TypedSlot, bindings::Bindings, ir::Core.CodeInfo) + # turn TypedSlot to SlotNumber + bind_var!(Core.SlotNumber(var.id), bindings, ir) + end end function bind_var!(var::Core.SlotNumber, bindings::Bindings, ir::Core.CodeInfo) get!(bindings[1], var, allocate_binding!(var, bindings, ir.slottypes[var.id]))