JuliaLabs / Cassette.jl

Overdub Your Julia Code
Other
370 stars 34 forks source link

Error on ColorTypes #202

Open bertschi opened 1 year ago

bertschi commented 1 year ago

In my library I use Cassette for function tracing and have encountered some errors. Have boiled it down to a minimal example:

using Cassette, ColorTypes
Cassette.@context Ctx

Base.typename(RGBA)  # works without issues
Cassette.overdub(Ctx(), Base.typename, RGBA)

The last call fails with the following stack trace

ERROR: type DataType has no field body
Stacktrace:
  [1] getproperty
    @ ./Base.jl:33 [inlined]
  [2] call
    @ ~/.julia/packages/Cassette/4Z3UO/src/context.jl:456 [inlined]
  [3] fallback
    @ ~/.julia/packages/Cassette/4Z3UO/src/context.jl:454 [inlined]
  [4] overdub
    @ ~/.julia/packages/Cassette/4Z3UO/src/context.jl:279 [inlined]
  [5] typename(::Type{RGBA})
    @ ./essentials.jl:327 [inlined]
  [6] overdub
    @ ./essentials.jl:327 [inlined]
  [7] overdub(::Cassette.Context{nametype(Ctx), Nothing, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::typeof(Base.typename), ::Type{RGBA})
    @ Cassette ~/.julia/packages/Cassette/4Z3UO/src/overdub.jl:0
  [8] typename(::Type{RGBA})
    @ ./essentials.jl:327 [inlined]
  [9] overdub
    @ ./essentials.jl:327 [inlined]
 [10] overdub(::Cassette.Context{nametype(Ctx), Nothing, Nothing, Cassette.var"##PassType#322", Nothing, Nothing}, ::typeof(Base.typename), ::Type{RGBA})
    @ Cassette ~/.julia/packages/Cassette/4Z3UO/src/overdub.jl:0
 [11] top-level scope
    @ REPL[4]:1

Guess that this is an issue in Cassette ... any ideas?

vchuravy commented 1 year ago

What version of Julia?

bertschi commented 1 year ago
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)

Cassette v0.3.11