File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -401,13 +401,14 @@ macro constprop(setting)
401401end
402402
403403function constprop_setting (@nospecialize setting)
404+ s = setting
404405 isa (setting, QuoteNode) && (setting = setting. value)
405406 if setting === :aggressive
406407 return :aggressive_constprop
407408 elseif setting === :none
408409 return :no_constprop
409410 end
410- throw (ArgumentError (LazyString (" @constprop " ), setting , " not supported" ))
411+ throw (ArgumentError (LazyString (" `Base. @constprop " , s , " ` not supported" ) ))
411412end
412413
413414"""
Original file line number Diff line number Diff line change @@ -1612,3 +1612,15 @@ let errs = IOBuffer()
16121612 '` , devnull , stdout , errs)
16131613 @test occursin (" disable_new_worlds" , String (take! (errs)))
16141614end
1615+
1616+ @testset " `@constprop`, `@assume_effects` handling of an unknown setting" begin
1617+ for x ∈ (" constprop" , " assume_effects" )
1618+ try
1619+ eval (Meta. parse (" Base.@$x :unknown f() = 3" ))
1620+ error (" unexpectedly reached" )
1621+ catch e
1622+ e:: LoadError
1623+ @test e. error isa ArgumentError
1624+ end
1625+ end
1626+ end
You can’t perform that action at this time.
0 commit comments