mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
error on C.Foo{!}
This commit is contained in:
parent
b2b34e18e4
commit
e32cbfcca7
@ -485,16 +485,17 @@ fn (p mut Parser) gen_struct_init(typ string, t Type) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// TODO tmp hack for 0 pointers init
|
|
||||||
// &User{!} ==> 0
|
|
||||||
if p.tok == .not {
|
if p.tok == .not {
|
||||||
p.warn('use `$t.name(0)` instead of `&$t.name{!}`')
|
// old &User{!} ==> 0 hack
|
||||||
|
p.error('use `$t.name(0)` instead of `&$t.name{!}`')
|
||||||
|
/*
|
||||||
p.next()
|
p.next()
|
||||||
p.gen('0')
|
p.gen('0')
|
||||||
p.check(.rcbr)
|
p.check(.rcbr)
|
||||||
return true
|
return true
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
p.gen('($t.name*)memdup(&($t.name) {')
|
p.gen('($t.name*)memdup(&($t.name) {')
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user