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

use the new &C.Foo(0) cast

This commit is contained in:
Alexander Medvednikov
2019-12-04 12:19:32 +03:00
parent 2bafd41183
commit b2b34e18e4
3 changed files with 4 additions and 3 deletions

View File

@ -488,6 +488,7 @@ fn (p mut Parser) gen_struct_init(typ string, t Type) bool {
// TODO tmp hack for 0 pointers init
// &User{!} ==> 0
if p.tok == .not {
p.warn('use `$t.name(0)` instead of `&$t.name{!}`')
p.next()
p.gen('0')
p.check(.rcbr)