Papierkorb / bindgen

Binding and wrapper generator for C/C++ libraries
GNU General Public License v3.0
179 stars 18 forks source link

Better support for recursive aliases #106

Closed HertzDevil closed 3 years ago

HertzDevil commented 3 years ago

Improves alias resolution of type names.

After a new alias is added, any internal aliases among the aliases' underlying types are immediately resolved; an alias then becomes recursive only if it refers to its own name. Bindgen now reports recursive aliases on addition, including loops and indirect recursions like T -> const T * or std::vector<T>. Alias resolution for user types is also faster, since type substitution occurs exactly once (in TypeDatabase#resolve_aliases).

For this to work correctly across various scenarios, even more Parser::Type objects have their full type names canonicalized:

Papierkorb commented 3 years ago

I think having CrystalProc added programatically is fine, it requires a lot of special treatment after all. And I think it'll stay the only that needs it for a long time (or forever).

LGTM 👍 Thanks!