Skip to content

Instantly share code, notes, and snippets.

@micklat
Created February 16, 2014 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micklat/9038888 to your computer and use it in GitHub Desktop.
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
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