Typedef struct inheriting basic type generates code that doesn't compile
Submitted by jmc..@..om.com
Link to original bug (#673388)
Description
If you declare a SimpleType struct that inherits from a basic type, i.e: int, the generated code doesn't compile
Reason is that the newly created type doesn't generate _dup and _free functions.. They could be generated by delegating on the original inherited base type ones. Also no typedef definition is generated..
[SimpleType] public struct ProcessId : int { public void kill() { //TODO } }
public static void main() { ProcessId pid = 5;
pid.kill();
}
test-typedef.vala.c: In function ‘process_id_get_type’: test-typedef.vala.c:24:82: error: ‘process_id_dup’ undeclared (first use in this function) test-typedef.vala.c:24:82: note: each undeclared identifier is reported only once for each function it appears in test-typedef.vala.c:24:115: error: ‘process_id_free’ undeclared (first use in this function) error: cc exited with status 256
Version: 0.16.x