Skip to content

Commit 63e411d

Browse files
committed
Don't unwrap conversion
1 parent 414e1c5 commit 63e411d

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.9.5"
3+
version = "0.9.6"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Operators/Operator.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ for f in [:iswrapperstructure, :iswrapperindexing, :iswrapperspaces]
8181
@eval $f(@nospecialize(_)) = false
8282
end
8383

84+
iswrapperstructure(A::Operator) = iswrapperstructure(typeof(A))
85+
iswrapperindexing(A::Operator) = iswrapperindexing(typeof(A))
86+
iswrapperspaces(A::Operator) = iswrapperspaces(typeof(A))
8487
iswrapper(A) = iswrapperstructure(A) || iswrapperindexing(A) || iswrapperspaces(A)
8588

8689
struct Functional <: OperatorStyle end
@@ -748,6 +751,9 @@ macro wrapper(Wrap, forwarddomain = true, forwardrange = true)
748751
end
749752

750753
unwrap(A::Operator) = iswrapper(A) ? A.op : A
754+
unwrapstructure(A::Operator) = iswrapperstructure(A) ? A.op : A
755+
unwrapindexing(A::Operator) = iswrapperindexing(A) ? A.op : A
756+
unwrapspace(A::Operator) = iswrapperspace(A) ? A.op : A
751757

752758
## Standard Operators and linear algebra
753759

src/Operators/banded/Conversion.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ end
129129
domainspace(C::ConversionWrapper) = C.domainspace
130130
rangespace(C::ConversionWrapper) = C.rangespace
131131

132+
ConversionWrapper(d::Space, r::Space, B::ConversionWrapper) =
133+
ConversionWrapper(d, r, B.op)
134+
132135
function ConversionWrapper(B::Operator,
133136
d::Space=domainspace(B), r::Space=rangespace(B))
134-
ConversionWrapper(d, r, unwrap(B))
137+
ConversionWrapper(d, r, B)
135138
end
136139
Conversion(A::Space,B::Space,C::Space) =
137140
ConversionWrapper(Conversion(B,C)*Conversion(A,B), A, C)

src/Operators/general/algebra.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ function check_times(ops)
226226
for k = 1:length(ops)-1
227227
size(ops[k], 2) == size(ops[k+1], 1) || throw(ArgumentError("incompatible operator sizes"))
228228
spacescompatible(domainspace(ops[k]), rangespace(ops[k+1])) ||
229-
throw(ArgumentError("incompatible spaces at index $k, received $(domainspace(ops[k])) and $(rangespace(ops[k+1]))"))
229+
throw(ArgumentError("incompatible spaces at index $k, received $(domainspace(ops[k])) and $(rangespace(ops[k+1])); ops = $ops"))
230230
end
231231
return nothing
232232
end
@@ -619,7 +619,7 @@ end
619619

620620
# Conversions we always assume are intentional: no need to promote
621621
function *(A::Conversion, B::Conversion)
622-
T = TimesOperator(unwrap(A), unwrap(B))
622+
T = TimesOperator(A, B)
623623
ConversionWrapper(T, domainspace(B), rangespace(A))
624624
end
625625
*(A::Conversion, B::TimesOperator) = TimesOperator(A, B)

0 commit comments

Comments
 (0)