File tree Expand file tree Collapse file tree 2 files changed +21
-13
lines changed Expand file tree Collapse file tree 2 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -5080,19 +5080,6 @@ end
5080
5080
@test f17255 (10000 )[1 ]
5081
5081
GC. enable (true )
5082
5082
5083
- # PR #39133, ensure that @time evaluates in the same scope
5084
- function time_macro_scope ()
5085
- @time time_macro_local_var = 1
5086
- time_macro_local_var
5087
- end
5088
- @test time_macro_scope () == 1
5089
-
5090
- function timev_macro_scope ()
5091
- @timev timev_macro_local_var = 1
5092
- timev_macro_local_var
5093
- end
5094
- @time timev_macro_scope () == 1
5095
-
5096
5083
# issue #18710
5097
5084
bad_tvars () where {T} = 1
5098
5085
@test isa (which (bad_tvars, ()), Method)
Original file line number Diff line number Diff line change @@ -231,6 +231,27 @@ v11801, t11801 = @timed sin(1)
231
231
232
232
@test names (@__MODULE__ , all = true ) == names_before_timing
233
233
234
+ # PR #39133, ensure that @time evaluates in the same scope
235
+ function time_macro_scope ()
236
+ try # try/throw/catch bypasses printing
237
+ @time (time_macro_local_var = 1 ; throw (" expected" ))
238
+ return time_macro_local_var
239
+ catch ex
240
+ ex === " expected" || rethrow ()
241
+ end
242
+ end
243
+ @test time_macro_scope () == 1
244
+
245
+ function timev_macro_scope ()
246
+ try # try/throw/catch bypasses printing
247
+ @timev (time_macro_local_var = 1 ; throw (" expected" ))
248
+ return time_macro_local_var
249
+ catch ex
250
+ ex === " expected" || rethrow ()
251
+ end
252
+ end
253
+ @test timev_macro_scope () == 1
254
+
234
255
# interactive utilities
235
256
236
257
struct ambigconvert; end # inject a problematic `convert` method to ensure it still works
You can’t perform that action at this time.
0 commit comments