Commit 4be4cb27 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix widest type calculation to never return references.

parent 412b5227
......@@ -4145,6 +4145,10 @@ def merge_template_deductions(a, b):
def widest_numeric_type(type1, type2):
"""Given two numeric types, return the narrowest type encompassing both of them.
"""
if type1.is_reference:
type1 = type1.ref_base_type
if type2.is_reference:
type2 = type2.ref_base_type
if type1 == type2:
widest_type = type1
elif type1.is_complex or type2.is_complex:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment