Weird typedef struct is translated incorrectly
aladagemre opened this issue · 3 comments
aladagemre commented
When generating binding for igraph see
typedef struct igraph_s {
igraph_integer_t n;
igraph_bool_t directed;
igraph_vector_t from;
igraph_vector_t to;
igraph_vector_t oi;
igraph_vector_t ii;
igraph_vector_t os;
igraph_vector_t is;
void *attr;
} igraph_t;
This code is translated into
struct S
n : IntegerT
directed : BoolT
from : VectorT
to : VectorT
oi : VectorT
ii : VectorT
os : VectorT
is : VectorT
attr : Void*
end
type T = S
And then uses T* whenever functions indeed expect S_. When we replace all T_ with S*, the code works.
aladagemre commented
asterite commented
I'm not sure what's the issue. Is it that T
is used instead of T*
? The type
declaration seems fine, although maybe in those cases declaring the struct as struct T
(without declaring S
) should be good?
aladagemre commented
when I use T.new, it says T doesn't have method new.
When I try to cast T to S, it says S can't be casted to T.
I don't know what's the reason for this.