Last active
August 29, 2015 14:15
-
-
Save Deco/5a58b5721bec07c4b09a to your computer and use it in GitHub Desktop.
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
{.experimental.} | |
type TArray {.borrow: `[]`.} = distinct array[0..3, int] | |
var a = TArray([1, 2, 3, 4]) | |
echo "yay", a[1] # Error: type mismatch: got (TArray, int literal(1)) | |
gmpreussner
commented
Feb 13, 2015
proc `[]`(a: TArray; idx: int): int {.borrow.}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment