[SR-12247] Replace the type alias ModuleDecl::ImportedModule
with a dedicated struct
#54674
Labels
ModuleDecl::ImportedModule
with a dedicated struct
#54674
Additional Detail from JIRA
md5: e0ba93c630c00648118ca45d93bdb575
Issue Description:
The code using it right now is unnecessarily challenging to read because there are `first` and `second` all over the place and one has no clue what is going on.
Instead, it would be good to replace it with a dedicated nested struct like so:
and update the code based on type errors (for example, you might need to update LLDB if it is using this type, or you might need to add 1-2 constructors which make this easy).
As part of the investigation, one should check if the `Module` is ever null. (The easy way to do this would be to have a constructor which asserts if it receives a nullptr). If so, try replacing the `ModuleDecl *` type with `NullablePtr<ModuleDecl>` and keep that if the resulting code is not too convoluted (it might help to add 1-2 convenience constructors). Otherwise, keep the assertion in and document the invariant in a comment.
Please @ me on GitHub (varungandhi-apple) or leave a comment here in case you need someone to guide you/review the PR.
The text was updated successfully, but these errors were encountered: