Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

@swernli
Copy link
Collaborator

@swernli swernli commented Aug 22, 2020

This takes advantage of the functionality introduced in microsoft/qsharp-compiler#581 that allows rewrite steps to know if ExposeReferencesViaTestNames was specified for the current compilation. Then CsharpGeneration rewrite step can only re-generate C# for references that both have a test name defined AND are being loaded by that test name. This fixes a bug where callables with a test name attribute would end up colliding with themselves if they were referenced without test name.

This was tested by temporarily adding a test name attribute to Microsoft.Quantum.Intrinsic.Measure, which would cause a compilation failure without these changes and compiles successfully with these changes.

This change makse it so that C# generation for references that have a test name attribute only happens when loading via test names is requested.
@swernli swernli changed the title Swernli/csharpgeneratoin test names fix Skip Csharp Generation of references with test names if not using test name Aug 22, 2020
Remove unused `e` variable.

Co-authored-by: Scott Carda <55811729+ScottCarda-MS@users.noreply.github.com>
@swernli swernli merged commit 7385c62 into master Aug 24, 2020
@swernli swernli deleted the swernli/csharpgeneratoin-TestNames-fix branch September 4, 2020 05:11
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