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

Conversation

@bamarsha
Copy link
Contributor

@bamarsha bamarsha commented Dec 9, 2020

Adds secondary diagnostics for unsupported capabilities that give the reasons why a callable from a library isn't supported. For example:

namespace Library {
    function MyResultAsBool(result : Result) : Bool {
        return result == One ? true | false;
    }
}
namespace App {
    open Library;

    operation Foo() : Bool {
        return MyResultAsBool(Zero);
    }
}

gives the diagnostics when compiled for Honeywell:

Error QS5027:
File: C:\Users\samarsha\Desktop\QSharpSandbox\App\App.qs
Position: [ln 5, cn 16]
The callable MyResultAsBool requires the FullComputation runtime capability, which is not supported by the target HoneywellProcessor.

Warning QS5024:
File: C:\Users\samarsha\Desktop\QSharpSandbox\App\App.qs
Position: [ln 5, cn 16]
MyResultAsBool: Measurement results cannot be compared here. The target HoneywellProcessor only supports comparing measurement results as part of the condition of an if- or elif-statement in an operation. [C:\Users\samarsha\Desktop\QSharpSandbox\Library\Library.qs:3:16]

Resolves #736.

Sarah Marshall and others added 30 commits November 17, 2020 15:12
@bamarsha
Copy link
Contributor Author

bamarsha commented Jan 8, 2021

@bettinaheim Could you take another look at your remaining open comments?

@github-actions github-actions bot merged commit 98e9930 into main Jan 13, 2021
@bamarsha bamarsha deleted the samarsha/capability-error-details branch January 15, 2021 18:17
bamarsha pushed a commit that referenced this pull request Jan 18, 2021
…ported required capability (#771)"

This reverts commit 98e9930.
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.

Better targeting-related error messages for multi-project Q# applications

4 participants