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

No-op overdub fails for Base.typename with UnionAll #130

Open
mbauman opened this issue Jun 18, 2019 · 5 comments
Open

No-op overdub fails for Base.typename with UnionAll #130

mbauman opened this issue Jun 18, 2019 · 5 comments

Comments

@mbauman
Copy link

mbauman commented Jun 18, 2019

julia> Cassette.@context Noop
Cassette.Context{nametype(Noop),M,T,P,B,H} where H<:Union{Cassette.DisableHooks, Nothing} where B<:Union{Nothing, IdDict{Module,Dict{Symbol,Cassette.BindingMeta}}} where P<:Cassette.AbstractPass where T<:Union{Nothing, Cassette.Tag} where M

julia> struct T2{T}
           x::T
       end

julia> Cassette.@overdub(Noop(), Base.typename(T2))
ERROR: type DataType has no field body
Stacktrace:
 [1] getproperty at ./Base.jl:15 [inlined]
 [2] call at /home/mbauman/.julia/dev/Cassette/src/context.jl:447 [inlined]
 [3] fallback at /home/mbauman/.julia/dev/Cassette/src/context.jl:445 [inlined]
 [4] overdub at /home/mbauman/.julia/dev/Cassette/src/context.jl:271 [inlined]
 [5] typename at ./essentials.jl:296 [inlined]
 [6] overdub(::Cassette.Context{nametype(Noop),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#399")),Nothing,Nothing}, ::typeof(Base.typename), ::Type{T2}) at /home/mbauman/.julia/dev/Cassette/src/overdub.jl:0
 [7] typename at ./essentials.jl:296 [inlined]
 [8] overdub(::Cassette.Context{nametype(Noop),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#399")),Nothing,Nothing}, ::typeof(Base.typename), ::Type{T2}) at /home/mbauman/.julia/dev/Cassette/src/overdub.jl:0
 [9] recurse(::Cassette.Context{nametype(Noop),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#399")),Nothing,Nothing}, ::getfield(Main, Symbol("##44#45"))) at /home/mbauman/.julia/dev/Cassette/src/overdub.jl:666
 [10] top-level scope at REPL[48]:1
@vchuravy
Copy link
Member

Hm this is weird, looking at it with Cthulhu it almost seems like we stashed a DataType in the args, but expected a Union...

@KristofferC
Copy link
Contributor

@bundasht
Copy link

@KristofferC Hey, any updates on this issue?
Thanks.

@kmsquire
Copy link

kmsquire commented Feb 2, 2020

I also ran into #142 (which was closed as a duplicate of this issue) when trying to use SimpleMock in one of my projects.

@ArbitRandomUser
Copy link

ArbitRandomUser commented Feb 21, 2022

encountered this issue with Luxor ; while using sethue

boiled down to the same error when using supertype on RGBA in Colors

julia> Cassette.overdub(ctx(),Colors.parse,RGBA,"red")
ERROR: type DataType has no field var
Stacktrace:
  [1] getproperty
    @ ./Base.jl:37 [inlined]
  [2] call
    @ ~/.julia/packages/Cassette/1lyEM/src/context.jl:456 [inlined]
  [3] fallback
    @ ~/.julia/packages/Cassette/1lyEM/src/context.jl:454 [inlined]
  [4] overdub
    @ ~/.julia/packages/Cassette/1lyEM/src/context.jl:279 [inlined]
  [5] overdub
    @ ./operators.jl:50 [inlined]
  [6] overdub(::Cassette.Context{nametype(ctx), Nothing, Nothing, Cassette.var"##PassType#276", Nothing, Nothing}, ::typeof(supertype), ::Type{RGBA})
    @ Cassette ~/.julia/packages/Cassette/1lyEM/src/overdub.jl:0
  [7] overdub
    @ ./operators.jl:50 [inlined]
  [8] overdub(::Cassette.Context{nametype(ctx), Nothing, Nothing, Cassette.var"##PassType#276", Nothing, Nothing}, ::typeof(supertype), ::Type{RGBA})
    @ Cassette ~/.julia/packages/Cassette/1lyEM/src/overdub.jl:0

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

No branches or pull requests

6 participants