From 3c8f344f8044df8e7dcc35c16d82207d522e5236 Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Sat, 13 Dec 2014 11:35:57 -0300 Subject: [PATCH] Removed unnecessary code now that we have a robust solution to the NoReturn issue --- src/compiler/crystal/semantic/type_inference.cr | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/compiler/crystal/semantic/type_inference.cr b/src/compiler/crystal/semantic/type_inference.cr index e94d1b13f1a5..f9348514ed1a 100644 --- a/src/compiler/crystal/semantic/type_inference.cr +++ b/src/compiler/crystal/semantic/type_inference.cr @@ -785,15 +785,7 @@ module Crystal check_call_in_initialize node @type_filters = nil - - if node.no_returns? - # If any call argument is NoReturn don't mark this call as unreachable. - # We only do so if the call itself has type NoReturn and all argument - # types are avaialble (such as a raise call, or another call invoking raise). - unless node.args.any? &.type?.try &.no_return? - @unreachable = true - end - end + @unreachable = true if node.no_returns? false end