Created
February 16, 2014 18:53
-
-
Save micklat/9038888 to your computer and use it in GitHub Desktop.
int not cast to float as expected, instead both values are cast to W
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 | |
W = object | |
x: float | |
PW = ref W | |
converter toW(x: int): PW = | |
new(result) | |
result.x = float(x) | |
converter toW(x: float): PW = | |
new(result) | |
result.x = x | |
var a : int = 4 | |
var b : float = 4 | |
assert(a==b) # this assertion fails |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment