# # # The Nim Compiler # (c) Copyright 2020 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. # ## Implementation of the check that `recover` needs, see ## https://github.com/nim-lang/RFCs/issues/244 for more details. import ast, types, renderer, intsets proc canAlias(arg, ret: PType; marker: var IntSet): bool proc canAliasN(arg: PType; n: PNode; marker: var IntSet): bool = case n.kind of nkRecList: for i in 0.. 0 and ret[0] != nil: result = canAlias(arg, ret[0], marker) else: result = true of tyTuple: for i in 0.. 0: result = checkIsolate(n[^1]) else: result = false else: # unanalysable expression: result = false else: # no ref, no cry: result = true