-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Vararg behaves strangely in Core.Typeof #30995
Comments
There's an explicit check for it here: Line 843 in 2ecc499
True, in this case the error "leaks":
and we could maybe use a better error. How did this come up? |
I wondered if that was the answer but didn't find that check, thanks!
I'm stress-testing JuliaInterpreter and a forthcoming rewrite of Revise that will (hopefully) be based around lowered code. Goal is to use JuliaInterpreter to extract signatures for all methods in Base and link them to the expressions that defined them. (Revise kinda does this now, but it misses lots, like all the for (mod, file) in Base._included_files
thunks = parse_and_lower_all_toplevel_exprs(mod, file)
for thunk in thunks
step_through_lines_and_intercept(stmt->isexpr(stmt, :method) || isexpr(:call_to_Core.eval, stmt), mod, thunk.args[1])
end
end I hit this specific issue when trying to interpret this line. I can obviously work around it, and this is pretty esoteric, so I will close it. Don't be surprised if I open a number of other "weird" issues as I progress. I should also say that I'm aware the overall strategy is a little scary; what happens when you step through |
It does seem explicitly wrong:
|
I guess it should return |
Probably. I'm guess that's how it is required to behave?
|
Also a more thorough workaround for JuliaLang/julia#30995
Although I guess there's also: julia> f(x::Type{T}) where {T} = T
f (generic function with 1 method)
julia> f(Vararg)
Vararg Which "proves" that Type{Vararg} is internally also though to be valid. |
The text was updated successfully, but these errors were encountered: