DAY #11

Type aliasing

Type aliasing is a way of giving a type a different name. It is useful for type-safe code organization, and cosmetics.

1
2
3
4
5
typealias Credit = Int

struct Course {
    let credits: Credit
}

Originally published 04/13/2021 @ https://pittcsc.org/ Discord

Published here on 09/08/2022. Blog published date reflects the original date of publication.