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 172
Type Parameter Resolution Combinations #543
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f0e36a2
First draft
ScottCarda-MS 360791c
Migrated the type parameter combining tests from call graph branch.
ScottCarda-MS 80fd7b3
Forgot to change the type name
ScottCarda-MS 6eb28dd
Basic setup for unit tests.
ScottCarda-MS 42ca2f5
Added some more tests.
ScottCarda-MS d50f596
Refactored the utility into a summary class that does the combining a…
ScottCarda-MS 9d2879b
Added/updated some documentation and updated some naming.
ScottCarda-MS 0341db4
Merge branch 'master' into sccarda/GeneralCombineTypeParams
ScottCarda-MS 0596893
Did some renaming.
ScottCarda-MS e29d5fe
Forgot to rename fields in tests.
ScottCarda-MS 4b4ec91
Removed the use of the term 'summary' and replaced it with 'combinati…
ScottCarda-MS a7936c9
Merge branch 'master' into sccarda/GeneralCombineTypeParams
ScottCarda-MS c308913
Made the more specific validation flags private fields.
ScottCarda-MS 4a68c46
Handled null mappings.
ScottCarda-MS 2cc56b8
Updated Classically Controlled Transformation to use the util.
ScottCarda-MS eb37ce4
Added order info to the doc comment for IndependentResolutionDictiona…
ScottCarda-MS 2b9f060
Added nullable enable
ScottCarda-MS d9af1f9
Updated ConstructorExtensions.fs to use AsTypeArguments static method.
ScottCarda-MS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
|
|
||
| // Identifier Resolution | ||
| namespace Microsoft.Quantum.Testing.TypeParameter { | ||
|
|
||
| operation Main() : Unit { | ||
| Foo<_, Int, String>(1.0, 2, "Three"); | ||
| } | ||
|
|
||
| operation Foo<'A, 'B, 'C>(a : 'A, b : 'B, c : 'C) : Unit { } | ||
| } | ||
|
|
||
| // ================================= | ||
|
|
||
| // Adjoint Application Resolution | ||
| namespace Microsoft.Quantum.Testing.TypeParameter { | ||
|
|
||
| operation Main() : Unit { | ||
| (Adjoint (Foo(1.0, 2, _)))("Three"); | ||
| } | ||
|
|
||
| operation Foo<'A, 'B, 'C>(a : 'A, b : 'B, c : 'C) : Unit is Adj { } | ||
| } | ||
|
|
||
| // ================================= | ||
|
|
||
| // Controlled Application Resolution | ||
| namespace Microsoft.Quantum.Testing.TypeParameter { | ||
|
|
||
| operation Main(qs : Qubit) : Unit { | ||
| (Controlled (Foo(1.0, 2, _)))([qs], "Three"); | ||
| } | ||
|
|
||
| operation Foo<'A, 'B, 'C>(a : 'A, b : 'B, c : 'C) : Unit is Ctl { } | ||
| } | ||
|
|
||
| // ================================= | ||
|
|
||
| // Partial Application Resolution | ||
| namespace Microsoft.Quantum.Testing.TypeParameter { | ||
|
|
||
| operation Main() : Unit { | ||
| (Foo(_, 3, "Hi"))(1.0); | ||
| } | ||
|
|
||
| operation Foo<'A, 'B, 'C>(a : 'A, b : 'B, c : 'C) : Unit { } | ||
| } | ||
|
|
||
| // ================================= | ||
|
|
||
| // Sub-call Resolution | ||
| namespace Microsoft.Quantum.Testing.TypeParameter { | ||
|
|
||
| operation Main() : Unit { | ||
| (Foo(1, 2, 3))(4); | ||
| } | ||
|
|
||
| operation Foo<'A, 'B, 'C>(a : 'A, b : 'B, c : 'C) : ('C => Unit) { return Bar<'A, 'B, 'C>(a, b, _); } | ||
|
|
||
| operation Bar<'A, 'B, 'C>(a : 'A, b : 'B, c : 'C) : Unit { } | ||
| } | ||
|
|
||
| // ================================= | ||
|
|
||
| // Argument Sub-call Resolution | ||
| namespace Microsoft.Quantum.Testing.TypeParameter { | ||
|
|
||
| operation Main() : Unit { | ||
| Foo(1.0, Bar(2), "Three"); | ||
| } | ||
|
|
||
| operation Foo<'A, 'B, 'C>(a : 'A, b : 'B, c : 'C) : Unit { } | ||
|
|
||
| operation Bar<'A>(a : 'A) : 'A { return a; } | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.