@@ -201,6 +201,23 @@ inner52938(x, types::Type, args...; kwargs...) = x
201
201
outer52938 (x) = @inline inner52938 (x, Tuple{}; foo= Ref (42 ), bar= 1 )
202
202
@test fully_eliminated (outer52938, (Any,); interp= Issue52938Interp (), retval= Argument (2 ))
203
203
204
+ # https://github.com/JuliaGPU/CUDA.jl/issues/2241
205
+ @newinterp Cuda2241Interp
206
+ @MethodTable CUDA_2241_MT
207
+ CC. method_table (interp:: Cuda2241Interp ) = CC. OverlayMethodTable (CC. get_inference_world (interp), CUDA_2241_MT)
208
+ inner52938 (f, types:: Type , args... ; kwargs... ) = nothing
209
+ function outer52938 (f)
210
+ @inline inner52938 (f, Tuple{}; foo= Ref (42 ), bar= 1 )
211
+ return nothing
212
+ end
213
+ # NOTE CUDA.jl overlays `throw_boundserror` in a way that causes effects, but these effects
214
+ # are ignored for this call graph at the `@assume_effects` annotation on `typejoin`.
215
+ # Here it's important to use `@consistent_overlay` to avoid tainting the `:nonoverlayed` bit.
216
+ const cuda_kernel_state = Ref {Any} ()
217
+ @consistent_overlay CUDA_2241_MT @inline Base. throw_boundserror (A, I) =
218
+ (cuda_kernel_state[] = (A, I); error ())
219
+ @test fully_eliminated (outer52938, (Nothing,); interp= Cuda2241Interp (), retval= Argument (2 ))
220
+
204
221
# Should not concrete-eval overlayed methods in semi-concrete interpretation
205
222
@newinterp OverlaySinInterp
206
223
@MethodTable OVERLAY_SIN_MT
0 commit comments