Last active
August 29, 2015 14:02
-
-
Save def-/cb05159fe18e3c3dfe12 to your computer and use it in GitHub Desktop.
Ambiguous
This file contains 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
type | |
Time = distinct float | |
Frequency = distinct float | |
Radioactivity = distinct float | |
proc `/` *(x: float, y: Time): Frequency = Frequency(x / float(y)) | |
proc `/` *(x: float, y: Time): Radioactivity = Radioactivity(x / float(y)) | |
# Error: ambiguous call; both ambiguous./(x: float, y: Time): Frequency and ambiguous./(x: float, y: Time): Radioactivity match for: (int literal(1), Time) | |
var fr: Frequency = 1 / Time(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment