Last active
February 11, 2020 07:28
-
-
Save lordcodes/56929abd1ec42dafa659994a6ce0892f to your computer and use it in GitHub Desktop.
Code for my article "Enforcing type safety of IDs in Kotlin"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun Team.inviteMember(id: MemberId) {} | |
| // ❌ Compile error: Type mismatch. | |
| team.inviteMember(team.id) | |
| // ✅ Compiles. | |
| team.inviteMember(member.id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment