mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: allow function expecting a void* to receive a byteptr
This commit is contained in:
parent
e63300e286
commit
9374168b26
19
vlib/builtin/isnil_test.v
Normal file
19
vlib/builtin/isnil_test.v
Normal file
@ -0,0 +1,19 @@
|
||||
fn test_isnil_byteptr(){
|
||||
pb := byteptr(0)
|
||||
assert isnil( pb )
|
||||
}
|
||||
|
||||
fn test_isnil_voidptr(){
|
||||
pv := voidptr(0)
|
||||
assert isnil( pv )
|
||||
}
|
||||
|
||||
fn test_isnil_charptr(){
|
||||
pc := &char(0)
|
||||
assert isnil( pc )
|
||||
}
|
||||
|
||||
fn test_isnil_intptr(){
|
||||
pi := &int(0)
|
||||
assert isnil( pi )
|
||||
}
|
@ -1161,6 +1161,7 @@ fn (p mut Parser) fn_call_args(f mut Fn) {
|
||||
}
|
||||
// println('\ne:"$expected" got:"$got"')
|
||||
else if ! (expected == 'void*' && got == 'int') &&
|
||||
! (expected == 'void*' && got == 'byteptr') &&
|
||||
! (expected == 'byte*' && got.contains(']byte')) &&
|
||||
! (expected == 'byte*' && got == 'string') &&
|
||||
//! (expected == 'void*' && got == 'array_int') {
|
||||
|
Loading…
Reference in New Issue
Block a user