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

We don't handle TypeTuple inputs like code_typed does #32

Closed
NHDaly opened this issue Apr 5, 2019 · 1 comment
Closed

We don't handle TypeTuple inputs like code_typed does #32

NHDaly opened this issue Apr 5, 2019 · 1 comment

Comments

@NHDaly
Copy link

NHDaly commented Apr 5, 2019

julia> code_typed(Tuple{typeof(Base.zero), Type{Tuple{Int64}}})
3-element Array{Any,1}:
                                                                                                                                                                      CodeInfo(
1 ─ %1 = Base.convert($(Expr(:static_parameter, 1)), x)::Tuple{typeof(zero),DataType}
└──      return %1
) => Tuple{typeof(zero),DataType}
 CodeInfo(
1 ─ %1 = $(Expr(:static_parameter, 1))::Core.Compiler.Const(Tuple{typeof(zero),Type{Tuple{Int64}}}, false)
│   %2 = Core._apply(Core.tuple, nt)::Tuple
│   %3 = Base.convert(%1, %2)::Tuple{typeof(zero),DataType}
└──      return %3
) => Tuple{typeof(zero),DataType}
                                                                                                                                               CodeInfo(
1 ─ %1 = Base._totuple($(Expr(:static_parameter, 1)), itr)::Core.Compiler.Const((zero, Tuple{Int64}), false)
└──      return %1
) => Tuple{typeof(zero),DataType}

But sadly:

julia> using Cthulhu

julia> descend_code_typed(Tuple{typeof(Base.zero), Type{Tuple{Int64}}})
ERROR: MethodError: no method matching descend_code_typed(::Type{Tuple{typeof(zero),Type{Tuple{Int64}}}})
Closest candidates are:
  descend_code_typed(::Any, ::Any; kwargs...) at /Users/nathan.daly/work/raicode-testing/.julia/packages/Cthulhu/cytTX/src/Cthulhu.jl:62
Stacktrace:
 [1] top-level scope at REPL[35]:1
@NHDaly
Copy link
Author

NHDaly commented Apr 5, 2019

JK JK i was mis-using code_typed. that's not a thing. This is behaving the same as code_typed and code_warntype. Carry on. :)

@NHDaly NHDaly closed this as completed Apr 5, 2019
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

1 participant