Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Make tuples with different arguments different types #198

Merged
merged 3 commits into from
Oct 5, 2018
Merged

Make tuples with different arguments different types #198

merged 3 commits into from
Oct 5, 2018

Conversation

MikhailArkhipov
Copy link

Fixes #173

Tuple protocols are compared by name which makes tuples with different types the same, which causes trouble in analysis hash set when it merges types of function parameters in overloads.

@@ -415,7 +415,7 @@ class TupleProtocol : IterableProtocol {
return AnalysisSet.UnionAll(constants.Select(GetItem));
}

public override string Name => "tuple";
public override string Name => "tuple[{0}]".FormatInvariant(string.Join(", ", _values.Select(v => v.GetShortDescriptions())));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can save it ctor to avoid multiple string creation.

@lostmsu
Copy link
Contributor

lostmsu commented Oct 4, 2018

Is short description unique enough? Should not FullyQualifiedName be used?

@MikhailArkhipov
Copy link
Author

@lostmsu - sure, why not

@lostmsu
Copy link
Contributor

lostmsu commented Oct 5, 2018

@MikhailArkhipov FYI, just pulled this PR locally. Whatever issue I had with the assert is gone.

@MikhailArkhipov MikhailArkhipov merged commit 565e23e into microsoft:master Oct 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants