Never types and inference

!: Default isn’t the big issue if we disregard the internals of default(). A more fundamental problem is that you can’t simultaneously support

!: Iterator<Item = u8>,
!: Iterator<Item = u16>,

Allowing this breaks the assumption in the type system which the associated type is a one-to-one relationship, as mentioned in Never types and inference and also Draft RFC: default types for traits.

(Note: I don’t think default trait = type is the correct answer to this problem)

5 Likes