Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Arslan <[email protected]>
Signed-off-by: Florian Atteneder <[email protected]>
  • Loading branch information
fatteneder and ararslan committed Oct 17, 2024
1 parent 9883b07 commit 877dc8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1301,8 +1301,12 @@ end

# sealing
f_sealed(x::Int64) = x+1
Base.seal_methodtable(Base.methods(f_sealed).mt)
Base.freeze!(Base.methods(f_sealed).mt)
@test_throws(
ErrorException("cannot add methods to or modify methods of a frozen function"),
@eval f_sealed(x::Float64) = x+2
)
Base.unfreeze!(Base.methods(f_sealed).mt)
f_sealed(x::Float64) = x + 2
@test f_sealed(1) == 2
@test f_sealed(1.0) == 2.0

0 comments on commit 877dc8c

Please sign in to comment.