346
346
347
347
# TODO : Hack to fix type instability in some branches that can't be inferred.
348
348
# 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)))
352
351
end
353
352
354
353
# This basically forms an if statement over the operators for the degree.
@@ -361,7 +360,7 @@ function inner_dispatch_degn_eval(
361
360
) where {T,degree}
362
361
return _inner_dispatch_degn_eval (
363
362
tree, cX, Val (degree), operators, eval_options
364
- ):: (_get_return_type(tree, cX, operators, eval_options) )
363
+ ):: (_get_return_type(tree, cX, eval_options) )
365
364
end
366
365
@generated function _inner_dispatch_degn_eval (
367
366
tree:: AbstractExpressionNode{T} ,
0 commit comments