PrintAst: Tie-break multiple class members created at the same source location

Otherwise Kotlin introducing a getter, setter and field declaration based on the same property tied in the sort order, and so could be output in different orders on different machines.
This commit is contained in:
Chris Smowton
2022-06-30 15:29:56 +01:00
parent 0d0d240fd4
commit ec95cbace4

View File

@@ -534,10 +534,12 @@ final class ClassInterfaceNode extends ElementNode {
or
childIndex >= 0 and
result.(ElementNode).getElement() =
rank[childIndex](Element e, string file, int line, int column |
e = this.getADeclaration() and locationSortKeys(e, file, line, column)
rank[childIndex](Element e, string file, int line, int column, string childStr |
e = this.getADeclaration() and
locationSortKeys(e, file, line, column) and
childStr = result.toString()
|
e order by file, line, column
e order by file, line, column, childStr
)
}
}