-
Notifications
You must be signed in to change notification settings - Fork 746
clang::Type::template_arg_type should return an Option<Type> #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please make a comment here if you intend to work on this issue. Thank you! |
Would it be appropriate to use iterator here instead as suggested for comment children, attributes here #166 ? |
If we go the iterator route, we can avoid the bounds checks, yes. However, if we do that we should also stop exposing an API to get the |
Yes, we should remove the There is a small trickiness compared to PR #169 for issue #166. would replace both: we use the number, but I don't know if it result in better code than having a single iterator interface. Regarding getting the |
Either that, or return an empty iterator that doesn't yield any items. I kind of prefer returning an |
Yes, for sure.
I think using https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.nth is fine if we already have iterators. |
clang::Type::template_args return Option<TypeTemplateArgIterator> Fix #136 by providing a bound checked iterator replacing the interface.
It isn't clear from the documentation whether or not an invalid type is returned by the FFI call if this type is not a template specialization. We should check whether or not it is, and if it is not return
None
. We should also bounds check thei
parameter.It will be useful to do this in the method so that every caller doesn't have to remember to do it. One less foot gun!
http://clang.llvm.org/doxygen/group__CINDEX__TYPES.html#ga9645640281c8d088982b2133f58edcb3
I can mentor whoever picks this up.
The text was updated successfully, but these errors were encountered: