This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Fix naming conflicts with generated C# members #349
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
|
Also, tip for reviewers: this PR looks scarier than it is. :) The main changes are in:
The rest I think should only be trivial renamings in response to these changes. |
ScottCarda-MS
approved these changes
Aug 20, 2020
Contributor
ScottCarda-MS
left a comment
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.
Thanks for pointing out where to find the main changes. That made reviewing much easier.
This was referenced Aug 25, 2020
Merged
bettinaheim
approved these changes
Aug 26, 2020
bamarsha
added a commit
to microsoft/QuantumKatas
that referenced
this pull request
Aug 28, 2020
This updates the QuantumKatas repo for the breaking changes to the Q# runtime that will be made by microsoft/qsharp-runtime#349: * Rename `Body` to `__Body__` in CounterSimulator.cs Co-authored-by: Sarah Marshall <samarsha@microsoft.com> Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the naming scheme in the generated C# to avoid conflicts with Q# identifiers. It assumes the Q# compiler reserves
__and_.anywhere in an identifier or namespace name, and_at the end of namespace names.C# generation also has its own list of reserved words. If these words are used, there is no error, but the name has
__appended to it to avoid a conflict:DataDeconstructInfoRunItemNwhereNis a natural numberAny built-in member names that are defined in a generated class need to be:
__, orThe protected properties in an operation class that are generated for referenced callables use this encoding:
.is replaced with__.__is appended to the end (but not the beginning, to avoid conflicts with built-in property names like__Body__).TODO:
Datatest after it is removed from the compiler's reserved words.Related issues:
Data. #37.Item*. #50.