bytecodealliance / bytecodealliance/wit-bindgen

c++ bindgen can have multiple name collisions

Open
#1,514 2 comments 0 reactions 0 assignees View on GitHub
gen-cpp
Dominant language
Rust
Stars
1.5k
Forks
286
Avg merge
6h 32m
Merged PRs (30d)
19

Description

## Summary
Another bucket of issues in `wit-bindgen cpp`.

Each one still makes the generated C++ fail to compile, possibly due to name collisions.

I can split this bucket into separate issues if needed.

## Environment
- wit-bindgen-cli: 0.47.0
- OS: Ubuntu 22.04.5 LTS (x86_64)

Same compile command: `clang++ -c "$OUT/w.cpp" -I"$OUT" -o "$OUT/w.o"`.

## Details

### Sub-issue 1

#### Reproduction
```
package demo:poc;

world w {
export a: interface {
f: func() -> u32;
}

export b: interface {
f: func() -> u64;
}
}
```

### Sub-issue 2

#### Reproduction
```
package namespace:demo;

interface i {
f: func();
}

world w {
export i;
}
```

### Sub-issue 3

#### Reproduction
```
package demo:poc;

world w {
import foo: func(ptr0: string) -> u32;
}
```

### Sub-issue 4

#### Reproduction
```
package demo:poc;

world w {
import foo: func(class: u32) -> u32;
}
```

### Sub-issue 5

#### Reproduction
```
package demo:poc;

interface i {
record t {
ret: u32,
}

foo: func(x: t);
}

world w {
import i;
}
```

### Sub-issue 6

#### Reproduction
```
package demo:poc;

interface i {
variant v {
v,
}
f: func(x: v);
}

world w {
export i;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.