-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fun[T:openArray](a:T) != fun[T](a:openArray[T]) #9032
Comments
They are not the same. The meaning of |
I think it's to allow this: proc foo[T](s: openarray[T]) =
echo s[0]
let a: array[3..6, int] = [10, 11, 12]
let s = @[10, 11, 12]
foo(a)
foo(s) The manual states that openarray parameters always start with 0. The difference with |
I am closing this, because I collect issues like this in my own issue here: #9592 |
fine, but the title you picked doesn't reflect that issue |
/cc @zah
Why is
fun[T:openArray](a:T)
not the same asfun[T](a:openArray[T])
?I was looking at #9002 and was wondering how it worked with openArrays with different
low
values (egarray[3..6, int]
andarray[2..5, int]
); it somehow works "thanks" to the fact thatfun[T:openArray](a:T)
!=fun[T](a:openArray[T])
, but is this desired behavior?The text was updated successfully, but these errors were encountered: