Skip to content

Commit 69f1280

Browse files
authored
Type-stability in polynomial space union (#293)
* Type-stability in polynomial space union * Bump version to v0.6.43
1 parent c48fd6f commit 69f1280

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunOrthogonalPolynomials"
22
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
3-
version = "0.6.42"
3+
version = "0.6.43"
44

55
[deps]
66
ApproxFunBase = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"

src/Spaces/PolynomialSpace.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ end
322322

323323

324324

325-
## All polynomial spaces can be converted provided spaces match
325+
## All polynomial spaces can be converted provided domains match
326326

327-
isconvertible(a::PolynomialSpace,b::PolynomialSpace) = domain(a) == domain(b)
328-
union_rule(a::PolynomialSpace{D},b::PolynomialSpace{D}) where {D} =
329-
domainscompatible(a,b) ? (a < b ? a : b) : NoSpace() # the union of two polys is always a poly
327+
isconvertible(a::PolynomialSpace, b::PolynomialSpace) = domain(a) == domain(b)
328+
union_rule(a::PolynomialSpace{D}, b::PolynomialSpace{D}) where {D} =
329+
conversion_type(a, b)
330330

331331

332332

test/UltrasphericalTest.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ include("testutils.jl")
1515
@verbose @testset "Ultraspherical" begin
1616
@testset "promotion" begin
1717
@inferred (() -> [Ultraspherical(1), Ultraspherical(2.0)])()
18+
f = Fun(Chebyshev())
19+
g = Fun(Ultraspherical(1))
20+
@test @inferred(f + g) 2f
1821
end
1922
@testset "identity fun" begin
2023
for d in (ChebyshevInterval(), 3..4, Segment(2, 5), Segment(1, 4im)), order in (1, 2, 0.5)

0 commit comments

Comments
 (0)