Skip to content

Commit

Permalink
Adapt to new async handling of compilation calls (microsoft#765)
Browse files Browse the repository at this point in the history
* Await async compile calls.

* Update to 0.24.199223-beta.

* Only update utilities.

* Only update utilities.

* Undo change to dumpunitary.
  • Loading branch information
cgranade authored Mar 22, 2022
1 parent 61b63e0 commit ba9c6db
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion utilities/Common/Common.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.23.198514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.24.199223-beta">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
Expand Down
4 changes: 2 additions & 2 deletions utilities/CounterSimulatorTests/CounterSimulatorTests.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.23.198514-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.24.199223-beta">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Xunit" Version="0.23.198514-beta" />
<PackageReference Include="Microsoft.Quantum.Xunit" Version="0.24.199223-beta" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
Expand Down
6 changes: 3 additions & 3 deletions utilities/Microsoft.Quantum.Katas/KataMagic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public virtual async Task<ExecutionResult> Run(string input, IChannel channel)
return ExecuteStatus.Error.ToExecutionResult();
}

var userAnswer = Compile(code, channel);
var userAnswer = await Compile(code, channel);
if (userAnswer == null) { return ExecuteStatus.Error.ToExecutionResult(); }

return Simulate(test, userAnswer, channel)
Expand All @@ -116,11 +116,11 @@ public virtual async Task<ExecutionResult> Run(string input, IChannel channel)
/// Compiles the given code. Checks there is only one operation defined in the code,
/// and returns its corresponding OperationInfo
/// </summary>
public virtual OperationInfo Compile(string code, IChannel channel)
public virtual async Task<OperationInfo> Compile(string code, IChannel channel)
{
try
{
var result = Snippets.Compile(code);
var result = await Snippets.Compile(code);

foreach (var m in result.warnings) { channel.Stdout(m); }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
Expand All @@ -17,7 +17,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.IQSharp.Jupyter" Version="0.23.198514-beta" PrivateAssets="All" />
<PackageReference Include="Microsoft.Quantum.IQSharp.Jupyter" Version="0.24.199223-beta" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit ba9c6db

Please sign in to comment.