File tree Expand file tree Collapse file tree 1 file changed +32
-31
lines changed Expand file tree Collapse file tree 1 file changed +32
-31
lines changed Original file line number Diff line number Diff line change @@ -663,42 +663,43 @@ function promote_to_concrete(vs; tofloat = true, use_union = true)
663
663
vs = Any[vs... ]
664
664
end
665
665
T = eltype (vs)
666
- if Base. isconcretetype (T) && (! tofloat || T === float (T)) # nothing to do
667
- return vs
668
- else
669
- sym_vs = filter (x -> SymbolicUtils. issym (x) || SymbolicUtils. iscall (x), vs)
670
- isempty (sym_vs) || throw_missingvars_in_sys (sym_vs)
671
-
672
- C = nothing
673
- for v in vs
674
- E = typeof (v)
675
- if E <: Number
676
- if tofloat
677
- E = float (E)
678
- end
679
- end
680
- if C === nothing
681
- C = E
682
- end
683
- if use_union
684
- C = Union{C, E}
685
- else
686
- @assert C== E " `promote_to_concrete` can't make type $E uniform with $C "
687
- C = E
688
- end
689
- end
690
666
691
- y = similar (vs, C)
692
- for i in eachindex (vs)
693
- if (vs[i] isa Number) & tofloat
694
- y[i] = float (vs[i]) # needed because copyto! can't convert Int to Float automatically
695
- else
696
- y[i] = vs[i]
667
+ # return early if there is nothing to do
668
+ # TODO : reenable after it was disabled to fix missing errors in https://github.com/SciML/ModelingToolkit.jl/issues/2873
669
+ # Base.isconcretetype(T) && (!tofloat || T === float(T)) && return vs
670
+
671
+ sym_vs = filter (x -> SymbolicUtils. issym (x) || SymbolicUtils. iscall (x), vs)
672
+ isempty (sym_vs) || throw_missingvars_in_sys (sym_vs)
673
+
674
+ C = nothing
675
+ for v in vs
676
+ E = typeof (v)
677
+ if E <: Number
678
+ if tofloat
679
+ E = float (E)
697
680
end
698
681
end
682
+ if C === nothing
683
+ C = E
684
+ end
685
+ if use_union
686
+ C = Union{C, E}
687
+ else
688
+ @assert C== E " `promote_to_concrete` can't make type $E uniform with $C "
689
+ C = E
690
+ end
691
+ end
699
692
700
- return y
693
+ y = similar (vs, C)
694
+ for i in eachindex (vs)
695
+ if (vs[i] isa Number) & tofloat
696
+ y[i] = float (vs[i]) # needed because copyto! can't convert Int to Float automatically
697
+ else
698
+ y[i] = vs[i]
699
+ end
701
700
end
701
+
702
+ return y
702
703
end
703
704
704
705
struct BitDict <: AbstractDict{Int, Int}
You can’t perform that action at this time.
0 commit comments