c2v icon indicating copy to clipboard operation
c2v copied to clipboard

fix issue #172

Open 1000copy opened this issue 1 year ago • 2 comments

fiix the bug of #172 [Can't translate compound struct and union; (https://github.com/vlang/c2v/issues/172)

testcase 1

  • case struct ss{ union{int i;int j;}; int i1; };
  • result struct Ss { ss0 i1 int } union ss0 { i int j int }

test case 2

  • case struct ss{ int i1; union{int i;int j;}; };
  • result struct Ss { ss0 i1 int } union ss0 { i int j int }

test case 3

  • case struct ss{ union{int i1;int j1;}; int i1; union{int i;int j;}; };
  • result struct Ss { ss0 ss1 i1 int } union ss0 { i1 int j1 int } union ss1 { i int j int }

1000copy avatar Feb 10 '24 14:02 1000copy

Thanks! Can you vfmt the code please?

medvednikov avatar Feb 11 '24 01:02 medvednikov

Also

tests/5.struct.v:103:13: error: `AnonStructTest0` lacks body
  101 | 
  102 |     age int
  103 |     foo struct AnonStructTest0 {
      |                ~~~~~~~~~~~~~~~
  104 |     bar int

medvednikov avatar Feb 11 '24 01:02 medvednikov