typing and engines: handle safe calls `x?.foo`