From 6c62fb1e70dff6ac55eecd40a9ada1da68a72259 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Mon, 1 Dec 2025 16:19:54 +0530 Subject: [PATCH] fix: fix prohibitively narrow type annotations in `SCCNonlinearProblem` --- src/problems/sccnonlinearproblem.jl | 6 ++---- src/systems/index_cache.jl | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/problems/sccnonlinearproblem.jl b/src/problems/sccnonlinearproblem.jl index 171265eefc..20afd4d7a8 100644 --- a/src/problems/sccnonlinearproblem.jl +++ b/src/problems/sccnonlinearproblem.jl @@ -1,5 +1,3 @@ -const TypeT = Union{DataType, UnionAll} - struct CacheWriter{F} fn::F end @@ -161,8 +159,8 @@ function SciMLBase.SCCNonlinearProblem{iip}(sys::System, op; eval_expression = f end # map from symtype to cached variables and their expressions - cachevars = Dict{Union{DataType, UnionAll}, Vector{Any}}() - cacheexprs = Dict{Union{DataType, UnionAll}, Vector{Any}}() + cachevars = Dict{TypeT, Vector{Any}}() + cacheexprs = Dict{TypeT, Vector{Any}}() # observed of previous SCCs are in the cache # NOTE: When we get proper CSE, we can substitute these # and then use `subexpressions_not_involving_vars!` diff --git a/src/systems/index_cache.jl b/src/systems/index_cache.jl index 2594bb06c0..0482e07c5f 100644 --- a/src/systems/index_cache.jl +++ b/src/systems/index_cache.jl @@ -1,5 +1,7 @@ +const TypeT = Union{DataType, UnionAll, Union} + struct BufferTemplate - type::Union{DataType, UnionAll, Union} + type::TypeT length::Int end