-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Can not convert array to string #766
Comments
From what I know, it's clear that you need to pass a "byteptr" type to the first argument, but you pass an array of "byteptr" instead. So, I think it's not a bug. That's just how it is. pub fn tos(s byteptr, len int) string {
// This should never happen.
if isnil(s) {
panic('tos(): nil string')
}
return string {
str: s
len: len
}
} |
So:
arr and arr3 can not be converted to string with tos() while arr2 can. I was trying another notation to use a const for the length of the array because of #762 |
|
Use
Closing this in favour of #934. |
Fixed:
|
V version: 0.1.8
OS: ubunti 16.04
What did you do?
What did you expect to see?
Compile and pass test
What did you see instead?
Compiler error:
The text was updated successfully, but these errors were encountered: