-
Notifications
You must be signed in to change notification settings - Fork 743
clang::Cursor::specialized should return an Option<clang::Cursor> #122
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! |
This looks fun and I will give it a shot today! |
Great! Don't hesitate to reach out if you run into any roadblocks :) |
This might be a silly question, but why is it possible for a cursor to be invalid? Shouldn't the presence of a |
Agreed! But we're using FFI to Clang and we don't get to decide how Clang represents its data structures :) We do want to make it so that our wrapper Fixing issues like this one will certainly help us get there, though! |
Right now,
clang::Cursor::specialized
returns aclang::Cursor
regardless if that resulting cursoris_valid()
or not. This is a footgun for callers, which have to remember to checkresulting_cursor.is_valid()
. Instead,specialized
should check for them and returnNone
if it is not a valid cursor, andSome
if it is.I can mentor someone who would like to pick up this bug.
The text was updated successfully, but these errors were encountered: