diff --git a/loopy/target/c/codegen/expression.py b/loopy/target/c/codegen/expression.py
index c111a02b75243b10de90b2d18d62e3759c575fa8..59ed77f9c17fa04d67e251c22bec88fc8b15936c 100644
--- a/loopy/target/c/codegen/expression.py
+++ b/loopy/target/c/codegen/expression.py
@@ -324,10 +324,11 @@ class ExpressionToCExpressionMapper(IdentityMapper):
                     self.rec(expr.denominator, 'i'))
 
     def map_if(self, expr, type_context):
+        result_type = self.infer_type(expr)
         return type(expr)(
                 self.rec(expr.condition, "i"),
-                self.rec(expr.then, type_context),
-                self.rec(expr.else_, type_context),
+                self.rec(expr.then, type_context, result_type),
+                self.rec(expr.else_, type_context, result_type),
                 )
 
     def map_comparison(self, expr, type_context):
diff --git a/loopy/version.py b/loopy/version.py
index aeb0b277a6c4de8a6db346aee97014699d591d03..b3033c3a90735f09260947c4d88632ce5e9aded8 100644
--- a/loopy/version.py
+++ b/loopy/version.py
@@ -32,7 +32,7 @@ except ImportError:
 else:
     _islpy_version = islpy.version.VERSION_TEXT
 
-DATA_MODEL_VERSION = "v77-islpy%s" % _islpy_version
+DATA_MODEL_VERSION = "v78-islpy%s" % _islpy_version
 
 
 FALLBACK_LANGUAGE_VERSION = (2017, 2, 1)
diff --git a/test/test_loopy.py b/test/test_loopy.py
index 8581ae5b879a7d9a282b5fefb9f3155928e83631..86351dd9340796a4511b2d422b1b86cf181786f2 100644
--- a/test/test_loopy.py
+++ b/test/test_loopy.py
@@ -2856,6 +2856,19 @@ def test_no_barriers_for_nonoverlapping_access(second_index, expect_barrier):
     assert barrier_between(knl, "first", "second") == expect_barrier
 
 
+def test_half_complex_conditional(ctx_factory):
+    ctx = ctx_factory()
+    queue = cl.CommandQueue(ctx)
+
+    knl = lp.make_kernel(
+            "{[i]: 0 <= i < 10}",
+            """
+           tmp[i] = if(i < 5, 0, 0j)
+           """)
+
+    knl(queue)
+
+
 if __name__ == "__main__":
     if len(sys.argv) > 1:
         exec(sys.argv[1])