src/basilisp/lang/compiler/optimizer.py
def visit_FunctionDef(self, node: ast.FunctionDef) -> Optional[ast.AST]:
        """Eliminate dead code from function bodies."""
        new_node = self.generic_visit(node)
        assert isinstance(new_node, ast.FunctionDef)
        return ast.copy_location(
            ast.FunctionDef(
                name=new_node.name,
                args=new_node.args,
                body=_filter_dead_code(new_node.body),
                decorator_list=new_node.decorator_list,
                returns=new_node.returns,
            ),
            new_node,
        )
def visit_FunctionDef(self, node: ast.FunctionDef) -> Optional[ast.AST]:
        new_node = self.generic_visit(node)
        assert isinstance(new_node, ast.FunctionDef)
        return ast.copy_location(
            ast.FunctionDef(
                name=new_node.name,
                args=new_node.args,
                body=_filter_dead_code(new_node.body),
                decorator_list=new_node.decorator_list,
                returns=new_node.returns,
            ),
            new_node,
        )
def visit_FunctionDef ( self , node : ast . FunctionDef ) -> Optional [ ast . AST ] : new_node = self . generic_visit ( node ) assert isinstance ( new_node , ast . FunctionDef ) return ast . copy_location ( ast . FunctionDef ( name = new_node . name , args = new_node . args , body = _filter_dead_code ( new_node . body ) , decorator_list = new_node . decorator_list , returns = new_node . returns , ) , new_node , )
Eliminate dead code from function bodies.
Eliminate dead code from function bodies .