Open shashi opened 4 years ago
A no-op context with tagging causes ()->1+2 to not infer.
()->1+2
using Cassette import Cassette: enabletagging, disablehooks, tag Cassette.@context DC function drun(f, x...) ctx = disablehooks(enabletagging(DC(), f)) Cassette.overdub(ctx, f, x...) end #= julia> @code_warntype drun(()->1+2) Variables #self#::Core.Compiler.Const(drun, false) f::Core.Compiler.Const(var"#10#11"(), false) x::Tuple{} ctx::Cassette.Context{nametype(DC),Nothing,Cassette.Tag{nametype(DC),0xd14e46825b5d9a56,Nothing},Cassette.var"##PassType#404",IdDict{Module,Dict{Symbol,Cassette.BindingMeta}},Cassette.DisableHooks} Body::Any 1 ─ %1 = Main.DC()::Core.Compiler.Const(Cassette.Context{nametype(DC),Nothing,Nothing,Cassette.var"##PassType#404",Nothing,Nothing}(nametype(DC)(), nothing, nothing, Cassette.var"##PassType#404"(), nothing, nothing), false) │ %2 = Main.enabletagging(%1, f)::Cassette.Context{nametype(DC),Nothing,Cassette.Tag{nametype(DC),0xd14e46825b5d9a56,Nothing},Cassette.var"##PassType#404",IdDict{Module,Dict{Symbol,Cassette.BindingMeta}},Nothing} │ (ctx = Main.disablehooks(%2)) │ %4 = Cassette.overdub::Core.Compiler.Const(Cassette.overdub, false) │ %5 = Core.tuple(ctx, f)::Core.Compiler.PartialStruct(Tuple{Cassette.Context{nametype(DC),Nothing,Cassette.Tag{nametype(DC),0xd14e46825b5d9a56,Nothing},Cassette.var"##PassType#404",IdDict{Module,Dict{Symbol,Cassette.BindingMeta}},Cassette.DisableHooks},var"#10#11"}, Any[Cassette.Context{nametype(DC),Nothing,Cassette.Tag{nametype(DC),0xd14e46825b5d9a56,Nothing},Cassette.var"##PassType#404",IdDict{Module,Dict{Symbol,Cassette.BindingMeta}},Cassette.DisableHooks}, Core.Compiler.Const(var"#10#11"(), false)]) │ %6 = Core._apply(%4, %5, x)::Any └── return %6 =#
It would be to nice to get tagging to be fast. This would be a first step.
A no-op context with tagging causes
()->1+2
to not infer.It would be to nice to get tagging to be fast. This would be a first step.