You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0dfb5ba
Browse filesBrowse the repository at this point in the historyBrowse files
Fix translations for unnamed function parameters (#197)
The current implementation of `GetNamedDeclAsString` defaults to
returning `self` whenever the declaration corresponds to an unnamed
function parameter. This leads to incorrect translations such as the
following:
```cpp
int main(int, char**) { return 0; }
```
```rust
fn main_0(self: i32, self: Ptr<Ptr<u8>>) -> i32 {
let self: Value<i32> = Rc::new(RefCell::new(self));
let self: Value<Ptr<Ptr<u8>>> = Rc::new(RefCell::new(self));
return 0;
}
```
This patch addresses this issue by changing `GetNamedDeclAsString` to
return `self` only when it is actually required, and `_` otherwise.
0 commit comments