Skip to content

Commit 29f5266

Browse files
committed
Use inference to decide the element type
Fixes failures when you can't construct an instance from the type. RigidBodyTreeInspector was an example package.
1 parent e7a96c5 commit 29f5266

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/b-splines/b-splines.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function BSplineInterpolation{N,Tel,TWeights<:Real,IT<:DimSpec{BSpline},GT<:DimS
2525
for _ in 2:N
2626
c *= c
2727
end
28-
T = typeof(c * zero(Tel))
28+
T = Core.Inference.return_type(*, Tuple{typeof(c), Tel})
2929

3030
BSplineInterpolation{T,N,typeof(A),IT,GT,pad}(A)
3131
end

src/gridded/gridded.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function GriddedInterpolation{N,TCoefs,TWeights<:Real,IT<:DimSpec{Gridded},pad}(
2828
for _ in 2:N
2929
c *= c
3030
end
31-
T = typeof(c * zero(TCoefs))
31+
T = Core.Inference.return_type(*, Tuple{typeof(c), TCoefs})
3232

3333
GriddedInterpolation{T,N,TCoefs,IT,typeof(knts),pad}(knts, A)
3434
end

0 commit comments

Comments
 (0)