Skip to content

Commit e330dec

Browse files
committed
fix 32Bit, 1.6
1 parent f179ff0 commit e330dec

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/basic_types.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ function coordinates(polygon::Polygon{N,T}) where {N,T}
322322
end
323323

324324
function Base.promote_rule(::Type{Polygon{N, T1}}, ::Type{Polygon{N, T2}}) where {N, T1, T2}
325-
return Polygon{N, promote_rule(T1, T2)}
325+
return Polygon{N, promote_type(T1, T2)}
326326
end
327327

328328
function Base.convert(::Type{Polygon{N, T}}, poly::Polygon{N}) where {N, T}
@@ -344,10 +344,6 @@ end
344344
function MultiPolygon(polygons::AbstractVector{<:AbstractPolygon{Dim,T}}) where {Dim,T}
345345
return MultiPolygon(convert(Vector{eltype(polygons)}, polygons))
346346
end
347-
function MultiPolygon(polygons::AbstractVector{<:AbstractPolygon{Dim}}) where {Dim}
348-
T = reduce(promote_type, typeof.(polygons), init = eltype(polygons))
349-
return MultiPolygon(convert(Vector{T}, polygons))
350-
end
351347

352348
Base.getindex(mp::MultiPolygon, i) = mp.polygons[i]
353349
Base.size(mp::MultiPolygon) = size(mp.polygons)

test/polygons.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
points = connect([1, 2, 3, 4, 5, 6], Point2f)
44
@test points isa Vector{Point2f}
55
points = connect([1, 2, 3, 4, 5, 6], Point2)
6-
@test points isa Vector{Point2i}
6+
@test points isa Vector{Point2{Int}}
77
polygon = Polygon(points)
88
@test polygon == Polygon(points)
99
@test polygon == copy(polygon)

0 commit comments

Comments
 (0)