move
extract type guard as a node
cleanup
add field reference and legacy resolve tests for it