Skip to content

Commit

Permalink
add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
fatteneder committed Oct 17, 2024
1 parent ed9ec6e commit ebb4150
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,12 @@ end

# disallow adding new methods
f_sealed(x::Int) = x+1
Base.morespecific!(which(f_frozen, (Int,)))
f_sealed(x::Integer) = x+2
@test_throws(
ErrorException("unsupported Method to disable"),
Base.morespecific!(which(f_sealed, (Int,)))
)
Base.morespecific!(which(f_sealed, (Integer,)))
@test_throws(
ErrorException("cannot add methods to or modify methods of a frozen function"),
@eval f_sealed(x::Float64) = x+2
Expand Down

0 comments on commit ebb4150

Please sign in to comment.