File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -400,13 +400,14 @@ macro constprop(setting)
400
400
end
401
401
402
402
function constprop_setting (@nospecialize setting)
403
+ s = setting
403
404
isa (setting, QuoteNode) && (setting = setting. value)
404
405
if setting === :aggressive
405
406
return :aggressive_constprop
406
407
elseif setting === :none
407
408
return :no_constprop
408
409
end
409
- throw (ArgumentError (LazyString (" @constprop " ), setting , " not supported" ))
410
+ throw (ArgumentError (LazyString (" `Base. @constprop " , s , " ` not supported" ) ))
410
411
end
411
412
412
413
"""
Original file line number Diff line number Diff line change @@ -1575,3 +1575,15 @@ end
1575
1575
end
1576
1576
@test ! occursin (" loop not unrolled" , out_err)
1577
1577
end
1578
+
1579
+ @testset " `@constprop`, `@assume_effects` handling of an unknown setting" begin
1580
+ for x ∈ (" constprop" , " assume_effects" )
1581
+ try
1582
+ eval (Meta. parse (" Base.@$x :unknown f() = 3" ))
1583
+ error (" unexpectedly reached" )
1584
+ catch e
1585
+ e:: LoadError
1586
+ @test e. error isa ArgumentError
1587
+ end
1588
+ end
1589
+ end
You can’t perform that action at this time.
0 commit comments