xamarin / binding-tools-for-swift

MIT License
160 stars 21 forks source link

Redo of IteratorProtocol with tests #768

Closed stephen-hawley closed 3 years ago

stephen-hawley commented 3 years ago

The existing implementation was done by hand, I redid it using BTfS entirely. The old code was untested and almost assuredly would not have worked. This code is halfway working to the extent that we can use an object that implements IteratorProtocol from swift correctly. There is an issue with sending one into swift, but fixing that now will make this (more) ungainly.

In testing this, I found that we weren't reflecting typealias declarations which are needed to understand how a class implementation a protocol with associated types binds the associated types. I also found that we weren't binding the generics in the interface implementation of the final type, so we do that too.