Fix missing __has_controljac function definition #1128
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1105 - Default
ODEInputFunctionconstructor fails because__has_controljacis not defined.Problem
The
ODEInputFunctionconstructor was failing withUndefVarError: __has_controljac not definedwhen using the default value for thecontroljackeyword argument. The constructor tries to call__has_controljac(f)but this function was never defined.Root Cause
The
__has_controljacfunction is referenced in theODEInputFunctionconstructor at lines 2123 and 4776 ofsrc/scimlfunctions.jl, but the function definition was missing from the list of utility functions.Solution
Added the missing function definition:
This follows the exact same pattern as other
__has_*utility functions in the codebase (like__has_paramjac,__has_jac_prototype,__has_controljac_prototype, etc.).Testing
✅ Verified the fix works with the original MRE:
ODEInputFunction((x, u, p, t) -> x; controljac = nothing)- works ✓ODEInputFunction((x, u, p, t) -> x)- now works ✓ (was failing before)The fix is minimal, follows existing patterns, and resolves the issue without affecting any other functionality.
Closes #1105
🤖 Generated with Claude Code