Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Tagging inference failure #159

Open
shashi opened this issue Jan 18, 2020 · 0 comments
Open

Simple Tagging inference failure #159

shashi opened this issue Jan 18, 2020 · 0 comments
Labels

Comments

@shashi
Copy link

shashi commented Jan 18, 2020

A no-op context with tagging causes ()->1+2 to not infer.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants