def eval_forward_ref(typ: _ForwardRef):
for frame in stack():<EOL><INDENT>m = getmodule(frame[<NUM_LIT:0>])<EOL>m_name = m.__name__ if m is not None else '<STR_LIT>'<EOL>if m_name.startswith('<STR_LIT>') or not m_name.startswith('<STR_LIT>'):<EOL><INDENT>try:<EOL><INDENT>return typ._eval_type(frame[<NUM_LIT:0>].f_globals, frame[<NUM_LIT:0>].f_locals)<EOL><DEDENT>except NameError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>raise InvalidForwardRefError(typ)<EOL>
Climbs the current stack until the given Forward reference has been resolved, or raises an InvalidForwardRefError

:param typ: the forward reference to resolve
:return: