File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -131,24 +131,24 @@ end
131
131
test_do_block ()
132
132
end
133
133
134
- @testset " Callable structs throw error" begin
135
- struct CallableStruct{T}
136
- val:: T
137
- end
138
- function (c:: CallableStruct )()
139
- return @__FUNCTION__
140
- end
141
- c = CallableStruct (5 )
142
- @test_throws UndefVarError c ()
143
- end
144
-
145
134
@testset " Error upon misuse" begin
146
135
@gensym A
147
136
@test_throws (
148
137
" @__FUNCTION__ can only be used within a function" ,
149
138
@eval (module $ A; @__FUNCTION__ ; end )
150
139
)
151
140
end
141
+
142
+ @testset " Callable structs throw error" begin
143
+ @gensym A
144
+ @eval module $ A
145
+ struct CallableStruct{T}; val:: T ; end
146
+ (c:: CallableStruct )() = @__FUNCTION__
147
+ end
148
+ @eval using .$ A: CallableStruct
149
+ c = CallableStruct (5 )
150
+ @test_throws " @__FUNCTION__ can only be used within a function" c ()
151
+ end
152
152
end
153
153
end
154
154
You can’t perform that action at this time.
0 commit comments