-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Shared: Make sure getMadRepresentation
is unique
#19777
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -686,6 +686,11 @@ module Make< | |||||||||||||||||||||||||||
derivedFluentFlowPush(_, _, _, head, tail, _) | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
pragma[nomagic] | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a doc comment explaining the purpose of
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to admit I would really appreciate a description of what's going on here. What would a collision look like? |
||||||||||||||||||||||||||||
private string getUniqueMadRepresentation(SummaryComponent c) { | ||||||||||||||||||||||||||||
result = strictconcat(string s | s = c.getMadRepresentation() | s, "/") | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||
* A (non-empty) stack of summary components. | ||||||||||||||||||||||||||||
* | ||||||||||||||||||||||||||||
|
@@ -732,7 +737,7 @@ module Make< | |||||||||||||||||||||||||||
exists(SummaryComponent head, SummaryComponentStack tail | | ||||||||||||||||||||||||||||
head = this.head() and | ||||||||||||||||||||||||||||
tail = this.tail() and | ||||||||||||||||||||||||||||
result = tail.getMadRepresentation() + "." + head.getMadRepresentation() | ||||||||||||||||||||||||||||
result = tail.getMadRepresentation() + "." + getUniqueMadRepresentation(head) | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
or | ||||||||||||||||||||||||||||
exists(SummaryComponent c | | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍