Skip to content

Commit

Permalink
define InteractiveUtils.@infer_effects (#49062)
Browse files Browse the repository at this point in the history
  • Loading branch information
anandijain authored Mar 23, 2023
1 parent 56950e2 commit 124abaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/InteractiveUtils/src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# macro wrappers for various reflection functions

import Base: typesof, insert!, replace_ref_begin_end!
import Base: typesof, insert!, replace_ref_begin_end!, infer_effects

separate_kwargs(args...; kwargs...) = (args, values(kwargs))

Expand Down Expand Up @@ -212,7 +212,7 @@ macro which(ex0::Symbol)
return :(which($__module__, $ex0))
end

for fname in [:code_warntype, :code_llvm, :code_native]
for fname in [:code_warntype, :code_llvm, :code_native, :infer_effects]
@eval begin
macro ($fname)(ex0...)
gen_call_with_extracted_types_and_kwargs(__module__, $(Expr(:quote, fname)), ex0)
Expand Down
2 changes: 2 additions & 0 deletions stdlib/InteractiveUtils/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -719,3 +719,5 @@ end
end
end
end

@test Base.infer_effects(sin, (Int,)) == InteractiveUtils.@infer_effects sin(42)

0 comments on commit 124abaa

Please sign in to comment.