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

Show more of the type where arguments don't match in MethodError #52740

Closed
rafaqz opened this issue Jan 4, 2024 · 2 comments
Closed

Show more of the type where arguments don't match in MethodError #52740

rafaqz opened this issue Jan 4, 2024 · 2 comments

Comments

@rafaqz
Copy link
Contributor

rafaqz commented Jan 4, 2024

The new type simplification is great but it isn't really "context aware"

In this example the key information about what causes the method error is lost due to type symplification with ....

I really want to know what is in Val{...}:

julia> DynamicGrids.descendable(sd)
ERROR: MethodError: no method matching _demo(::DynamicGrids.Descend, ::DynamicGrids.RuleData{…}, ::SetNeighbors{…}, ::Val{…})

Closest candidates are:
  _demo(::DynamicGrids.DemoMode, ::DynamicGrids.RuleData{<:Any, N}, ::Any, ::Val{<:CellRule}) where N
   @ DynamicGrids ~/.julia/dev/DynamicGrids/src/utils.jl:72
  _demo(::DynamicGrids.DemoMode, ::DynamicGrids.RuleData{<:Any, N}, ::Any, ::Val{<:SetCellRule}) where N
   @ DynamicGrids ~/.julia/dev/DynamicGrids/src/utils.jl:87
  _demo(::DynamicGrids.DemoMode, ::DynamicGrids.RuleData{<:Any, N}, ::Any, ::Val{<:Union{var"#s106", var"#s105"} where {var"#s106"<:NeighborhoodRule, var"#s105"<:(Chain{<:Any, <:Any, <:Tuple{var"#s101", Vara
rg} where var"#s101"<:NeighborhoodRule})}}) where N
   @ DynamicGrids ~/.julia/dev/DynamicGrids/src/utils.jl:54

The problem is a little clearer in screenshot where the red highlighting of arguments is visible:

2024-01-04-153537_1210x225

Here we can't see why our arguments don't match the existing methods. We may be able to be a little smarter about this - showing more information to the point where the reason for the MethodError is clear.

@rafaqz rafaqz changed the title Show full type where arguments don't match in MethodError Show more of the type where arguments don't match in MethodError Jan 4, 2024
@KristofferC
Copy link
Member

Dup of #52113?

@rafaqz
Copy link
Contributor Author

rafaqz commented Jan 4, 2024

Yeah, couldn't find it searching issues

@rafaqz rafaqz closed this as completed Jan 4, 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

2 participants