ivansafrin/Polycode — Issue #61: create_lua_library chokes if method arguments are anonymous
Author: mcclure
Created: 2011-11-30 06:02:59+00:00
State: open

So I'm running create_lua_library.py on some of my header files. One of my header files contains a class, which has a method prototype in which the variable is not named. It looks like this:

```C++
struct terminal_auto : public automaton { // Overlay
...
void print_line(const string &);
...
};
```

This causes create_lua_library to generate garbage code for print_line:

```C++
static int Project_terminal_auto_print_line(lua_State *L) {
luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
terminal_auto *inst = (terminal_auto*)lua_topointer(L, 1);
luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
string & = *(string*)lua_topointer(L, 2);
inst->print_line(&);
return 0;
}
```

This is not valid C++ and does not compile.

If I name the variable:

```C++
struct terminal_auto : public automaton { // Overlay
...
void print_line(const string &line);
...
};
```

THIS generates perfectly valid lua.