[SR-13490] compareImports() in ModuleInterfacePrinting.cpp looks buggy #55932
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
good first issue
Good for newcomers
swift 5.3
textual interfaces
unexpected behavior
Bug: Unexpected behavior or incorrect output
Additional Detail from JIRA
md5: 97cef930f2abbe7b555cc59e458e7f87
Issue Description:
The helper function
compareImports()
in ModuleInterfacePrinting.cpp attempts to compare twoImportDecl
s by their import paths (the dotted identifiers in them) to sort them into a stable order, but if the two import paths have different numbers of identifiers, it looks like it will consider them equal.I don't have a test case that will actually cause buggy behavior, so you will need to:
1\ Read the code around it to figure out how it is used.
2. Devise a test case that will cause visibly buggy behavior.
3. Actually fix the bug.
I noticed this while working on a large pull request that touches this code; please wait until I've landed that to fix this bug.
The text was updated successfully, but these errors were encountered: