Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue #172 #174

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix issue #172 #174

wants to merge 2 commits into from

Conversation

1000copy
Copy link

@1000copy 1000copy commented Feb 10, 2024

fiix the bug of #172 [Can't translate compound struct and union; (https://github.com//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
    }

@medvednikov
Copy link
Member

Thanks! Can you vfmt the code please?

@medvednikov
Copy link
Member

Also

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants