lazy type resolution fixes #920, #922
also relevant to #918, #919
oops
tests for #922, #920
more tests for ordering issues