JuliaDiff / JuliaDiff/ChainRulesCore.jl
Better error message when using @scalar_rule on functors/closures
Open
Nobody has claimed this yet.
rule definition helper
- Dominant language
- Julia
- Stars
- 267
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
struct MyStruct
a
end
(m::MyStruct)(t) = m.a
@scalar_rule (m::Struct)(t) one(m.a)
Results in UndefVarError: m not defined.
As per the docs, this should not work. @oxinabox pointed out on slack that this should lead to a more meaningful error message.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the @scalar_rule implementation and reproduce the MyStruct functor example from the issue. Trace why it reports UndefVarError: m not defined, then make the unsupported functor or closure form produce a more meaningful error consistent with the documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100