-
-
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
Generic fallbacks for type reflection #43253
Comments
FWIW, Line 499 in 6bea8e3
To me, the essential problem here seems to be that actual method signatures of those reflection tools are sometimes not reflected in documentation. So I guess it would be more appropriated if your PR takes a direction of syncing the actual method signatures with those described in docstrings. |
AFAICT
|
At least on 1.7.0 i get ERROR: MethodError: no method matching isstructtype(::IdDict{Any, Any})
Closest candidates are:
isstructtype(::Type) at ~/.asdf/installs/julia/1.7.0/share/julia/base/reflection.jl:499
Stacktrace:
[1] (::var"#5#6")(x::Symbol)
@ Main ./REPL[5]:1
[2] filter(f::var"#5#6", a::Vector{Symbol})
@ Base ./array.jl:2484
[3] top-level scope
@ REPL[5]:1 |
I think it would make sense for the reflection functions on types such as
isstructtype
,isabstracttype
, etc. to have the generic fallbackFor example getting the names of all types defined in a module via
currently errors.
I'd happy to make a PR if this would be a worthwhile addition to Base.
The text was updated successfully, but these errors were encountered: