v icon indicating copy to clipboard operation
v copied to clipboard

Redeclaring C structs should error

Open ntrel opened this issue 4 years ago • 1 comments

V version: recent V OS: Windows 8

What did you do?

struct C.dirent {
	d_name [256]char
}

struct C.dirent {
	d_name byteptr
}

What did you expect to see? Error, redeclaration

What did you see instead? No error

ntrel avatar Feb 16 '21 18:02 ntrel

The comment in this commit says // allow duplication of C Structs in https://github.com/vlang/v/commit/6f474913cf862be4c5bd5596647c29f973bf598f so it has been done by on purpose :thinking:

Delta456 avatar Feb 22 '21 08:02 Delta456