Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var num = 1
- proc `[]`(v: ptr int, index: float) =
- echo index
- addr(num)[3.4]
- #ERROR: Test.nim(6, 9) Error: type mismatch: got (int, float)
- # but expected one of:
- # Test.[](v: ptr int, index: float)
- # system.[](a: array[Idx, T], x: TSlice[Idx]): seq[T]
- # system.[](a: array[Idx, T], x: TSlice[int]): seq[T]
- # system.[](s: string, x: TSlice[int]): string
- # system.[](s: seq[T], x: TSlice[int]): seq[T]
- # > Process terminated with exit code 256
Advertisement
Add Comment
Please, Sign In to add comment