From 0b307a479b0453d4506a379e731b02eb42bd3089 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Wed, 16 Mar 2022 12:27:40 +0900 Subject: [PATCH] adapt to upstream changes to `Base.return_types` Especially this commits adds the update corresponding to . --- src/validation.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/validation.jl b/src/validation.jl index 3125c2b6..84438044 100644 --- a/src/validation.jl +++ b/src/validation.jl @@ -16,7 +16,12 @@ function check_method(@nospecialize(job::CompilerJob)) cache = ci_cache(job) mt = method_table(job) interp = GPUInterpreter(cache, mt, job.source.world) - rt = Base.return_types(job.source.f, job.source.tt, interp)[1] + @static if VERSION ≥ v"1.8-beta2" + # https://github.com/JuliaLang/julia/pull/44515 + rt = Base.return_types(job.source.f, job.source.tt; interp)[1] + else + rt = Base.return_types(job.source.f, job.source.tt, interp)[1] + end if rt != Nothing throw(KernelError(job, "kernel returns a value of type `$rt`", """Make sure your kernel function ends in `return`, `return nothing` or `nothing`.