Skip to content

Commit 7badcc1

Browse files
authored
Merge pull request #132 from SymbolicML/fix-recursive-interest
fix: recursive type inference issue
2 parents b80be2a + 002be14 commit 7badcc1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DynamicExpressions"
22
uuid = "a40a106e-89c9-4ca8-8020-a735e8728b6b"
33
authors = ["MilesCranmer <[email protected]>"]
4-
version = "2.0.0"
4+
version = "2.0.1"
55

66
[deps]
77
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/Evaluate.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,8 @@ end
346346

347347
# TODO: Hack to fix type instability in some branches that can't be inferred.
348348
# It does this using the other branches, which _can_ be inferred.
349-
@unstable function _get_return_type(tree, cX, operators, eval_options)
350-
# public Julia API version of `Core.Compiler.return_type(_eval_tree_array, typeof((tree, cX, operators, eval_options)))`
351-
return eltype([_eval_tree_array(tree, cX, operators, eval_options) for _ in 1:0])
349+
@unstable function _get_return_type(tree, cX, eval_options)
350+
return Core.Compiler.return_type(deg0_eval, typeof((tree, cX, eval_options)))
352351
end
353352

354353
# This basically forms an if statement over the operators for the degree.
@@ -361,7 +360,7 @@ function inner_dispatch_degn_eval(
361360
) where {T,degree}
362361
return _inner_dispatch_degn_eval(
363362
tree, cX, Val(degree), operators, eval_options
364-
)::(_get_return_type(tree, cX, operators, eval_options))
363+
)::(_get_return_type(tree, cX, eval_options))
365364
end
366365
@generated function _inner_dispatch_degn_eval(
367366
tree::AbstractExpressionNode{T},

0 commit comments

Comments
 (0)