JuliaDiff / JuliaDiff/ChainRulesCore.jl

Get rid of `MethodError: no method matching iterate(::Nothing)`

Open
#632 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking
Dominant language
Julia
Stars
267
Forks
66
PR merge metrics
No merged PRs in 30d

Description

This frequent error happens because of the default dispatches

frule(ȧrgs, f, ::Vararg{Any}) = nothing
rrule(::Any, ::Vararg{Any}) = nothing

so when no rrule is defined, nothing is returned.
Unfortunately, it is hard to catch because the computations with nothing can go on for a while before erroring.

I wonder if removing these default dispatches would break something badly?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the default frule and rrule dispatches shown in the issue and tracing how their nothing result is consumed. Determine whether removing them breaks existing behavior, then define the intended replacement behavior and add coverage for calls without a matching rule; the issue does not name specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.