Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify macro does not permit templating? #100

Open
MikaelSlevinsky opened this issue Jun 10, 2021 · 1 comment
Open

simplify macro does not permit templating? #100

MikaelSlevinsky opened this issue Jun 10, 2021 · 1 comment

Comments

@MikaelSlevinsky
Copy link
Member

I assume that's what's wrong with this

julia> using QuasiArrays, ContinuumArrays

julia> import ContinuumArrays: @simplify

julia> struct MyOp{T,Ax} <: QuasiArrays.LazyQuasiMatrix{T}
           axis::Ax
       end

julia> @simplify function *(A::MyOp, P::Basis{T}) where T
           P * Diagonal(1:∞)
       end
ERROR: LoadError: AssertionError: (qt.args[1]).head == :call
Stacktrace:
 [1] var"@simplify"(__source__::LineNumberNode, __module__::Module, qt::Any)
   @ ContinuumArrays ~/.julia/packages/ContinuumArrays/tg4mj/src/operators.jl:21
in expression starting at REPL[5]:1

Maybe it's not an issue because macros work with types?

@dlfivefifty
Copy link
Member

Yes, unfortunately. Use eltype(P) instead (unless you want to fix the macro)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants