Type checking for subranges