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
131131 test_do_block ()
132132 end
133133
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-
145134 @testset " Error upon misuse" begin
146135 @gensym A
147136 @test_throws (
148137 " @__FUNCTION__ can only be used within a function" ,
149138 @eval (module $ A; @__FUNCTION__ ; end )
150139 )
151140 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
152152 end
153153end
154154
You can’t perform that action at this time.
0 commit comments