From 4174134108fdef462c2483f4ca5aa40dd6398d55 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 7 Feb 2016 00:23:05 -0700 Subject: unreachable return type can cast to any other return type --- src/analyze.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index 4f980df9d5..bd31abd6a7 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1655,8 +1655,10 @@ static bool types_match_const_cast_only(TypeTableEntry *expected_type, TypeTable if (expected_type->data.fn.fn_type_id.is_cold != actual_type->data.fn.fn_type_id.is_cold) { return false; } - if (!types_match_const_cast_only(expected_type->data.fn.fn_type_id.return_type, - actual_type->data.fn.fn_type_id.return_type)) + if (actual_type->data.fn.fn_type_id.return_type->id != TypeTableEntryIdUnreachable && + !types_match_const_cast_only( + expected_type->data.fn.fn_type_id.return_type, + actual_type->data.fn.fn_type_id.return_type)) { return false; } -- cgit v1.2.3