fix struct/dc's flatness test so that contracts with lazy fields aren't flat

closes PR 14558