Skip to content

Commit

Permalink
Make RuntimeGeneratedFunction <: Function
Browse files Browse the repository at this point in the history
Seems like a good place to put it in the type hierarchy.
  • Loading branch information
c42f committed Oct 24, 2020
1 parent 1959bba commit 173ac50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/RuntimeGeneratedFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export @RuntimeGeneratedFunction
This type should be constructed via the macro @RuntimeGeneratedFunction.
"""
struct RuntimeGeneratedFunction{argnames,moduletag,id}
struct RuntimeGeneratedFunction{argnames,moduletag,id} <: Function
body::Expr
function RuntimeGeneratedFunction(moduletag, ex)
def = splitdef(ex)
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ f1 = @RuntimeGeneratedFunction(ex1)
f2 = @RuntimeGeneratedFunction(ex2)
f3 = @RuntimeGeneratedFunction(ex3)

@test f1 isa Function

du = rand(2)
u = rand(2)
p = nothing
Expand Down

0 comments on commit 173ac50

Please sign in to comment.