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

Warning: couldn't retrieve source of function #513

Closed
dafred94 opened this issue Nov 3, 2023 · 2 comments
Closed

Warning: couldn't retrieve source of function #513

dafred94 opened this issue Nov 3, 2023 · 2 comments

Comments

@dafred94
Copy link

dafred94 commented Nov 3, 2023

software versions

  • OS: Windows 10 (64 Bit)
  • Julia v1.9.3
  • Cthulhu v2.9.5
  • ProfileView v1.7.2
  • Revise v3.5.7

MWE

When I enter this example code

using Revise
using Cthulhu
using ProfileView

function foo()
    T = rand() > 0.5 ? Int64 : Float64
    sum(rand(T, 100))
end

@descend foo()

, I see the following:

foo() @ Main c:\Users\Fred\git_managed\myFile.jl:656
┌ Warning: couldn't retrieve source of foo() @ Main c:\Users\Fred\git_managed\myFile.jl:656
└ @ TypedSyntax C:\Users\Fred\.julia\packages\TypedSyntax\LVzdW\src\node.jl:36
Variables
  #self#::Core.Const(foo)
  T::Union{Type{Float64}, Type{Int64}}
  @_3::Union{Type{Float64}, Type{Int64}}

∘ ─ %0 = invoke foo()::Union{Float64, Int64}
    @ c:\Users\Fred\git_managed\myFile.jl:657 within `foo`
1 ─       Core.NewvarNode(:(T))::Any
│   %2  = Main.rand()::Float64
│   %3  = (%2 > 0.5)::Bool
└──       goto #3 if not %3
2 ─       (@_3 = Main.Int64)::Core.Const(Int64)
└──       goto #4
3 ─       (@_3 = Main.Float64)::Core.Const(Float64)
4 ┄       (T = @_3)::Union{Type{Float64}, Type{Int64}}
│   @ c:\Users\Fred\git_managed\myFile.jl:658 within `foo`
│   %9  = Main.rand(T, 100)::Union{Vector{Float64}, Vector{Int64}}
│   %10 = Main.sum(%9)::Union{Float64, Int64}
└──       return %10
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [w]arn, [h]ide type-stable statements, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native, [j]ump to source always, [v]scode: inlay types, [V]scode: diagnostics.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
 • %2 = rand()::Float64
   %3 = >(::Float64,::Float64)::Bool
   %9 = call → rand(::Union{Type{Float64}, Type{Int64}},::Int64)::Union{Vector{Float64}, Vector{Int64}}
   %10 = call → sum(::Union{Vector{Float64}, Vector{Int64}})::Union{Float64, Int64}
   ↩

Can I do something so that I see... well the source code instead?

@timholy
Copy link
Member

timholy commented Jul 11, 2024

Works for me on both Windows and Linux.

@simeonschaub
Copy link
Collaborator

I am going to close this for now, please reopen if it's still an issue on 1.10

@simeonschaub simeonschaub closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2024
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

3 participants