Fix parsing of dotted rest when there is an expected type.