v icon indicating copy to clipboard operation
v copied to clipboard

Passing a voidptr causes type conflict

Open Undumendil opened this issue 7 years ago • 1 comments

Input:

fn main() {
	a := voidptr('AAAAAAAA'.str)
	b := ptr_str(a)
	println(b)
}

Output:

Fn "ptr_str" wrong arg #1. Expected "void*" (ptr)  but got "voidptr"

Any function with a parameter of type voidptr produces that error.

Undumendil avatar Jun 21 '19 18:06 Undumendil

Fixed:

voidptr can only be used in unsafe code

medvednikov avatar Jun 21 '19 19:06 medvednikov