Skip to content

clang::Cursor should never be the null cursor #119

@fitzgen

Description

@fitzgen

Right now we have various methods on clang::Cursor that return Options just because (I think?) we call underlying clang functions that return null if the cursor is the "null cursor" (see clang_getNullCursor and clang_isNull).

It would be better if these methods did not return Option and always returned a value, if clang::Cursor was never the null cursor, and the place(s) where we first get a cursor return an Option<Cursor> to handle the null cursor case. If we adopt these invariants, we should also assert them throught clang::Cursor methods.

What do you think @emilio?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions