From a850b7efd3734d5d1f2aa4bbbe42601d7c375e96 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Thu, 25 Jun 2020 19:14:53 +0200 Subject: [PATCH] add a test for #30739 (#36395) --- test/compiler/codegen.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/compiler/codegen.jl b/test/compiler/codegen.jl index 254548bf6126c..f90ed2a96d815 100644 --- a/test/compiler/codegen.jl +++ b/test/compiler/codegen.jl @@ -444,3 +444,10 @@ function _handle_message_test() return _handle_progress_test(progress) end @test _handle_message_test() isa Tuple{Base.UUID, String} + +@testset "#30739" begin + ifelsetuple(n::Integer, k::Integer, f, g) = ntuple(i -> (i <= k ? f : g), n) + f(x) = x^2; g(x) = x^3; + a = [1]; b = [2] + @test ifelsetuple(5, 3, a, b) == ([1], [1], [1], [2], [2]) +end