Deduce the correct type-checker order for type annotations