1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: access index when casting array into an array[] for pointer

This commit is contained in:
Henrixounez 2019-08-24 23:21:13 +02:00 committed by Alexander Medvednikov
parent f22d5c5624
commit 0a0d6536c2

View File

@ -898,7 +898,7 @@ fn (p mut Parser) fn_call_args(f mut Fn) *Fn {
// have to use `(array[]){ expr }` hack.
if expected.starts_with('array_') && expected.ends_with('*') {
p.cgen.set_placeholder(ph, '& /*111*/ (array[]){')
p.gen('} ')
p.gen('}[0] ')
}
// println('\ne:"$expected" got:"$got"')
else if ! (expected == 'void*' && got == 'int') &&