CodeGeneration.GenerateFunctorSpecializations Method

Definition

Given a Q# compilation, evaluates all functor generator directives and builds a new compilation where the corresponding elements in the syntax tree are replaced by the generated implementations. If the evaluation fails, the corresponding callable is left unchanged in the new tree. This is the case e.g. if more than one specialization of the same kind exists for a callable which causes an ArgumentException to be thrown. Any thrown exception is logged using the given onException action and are silently ignored if onException is not specified or null. Returns a boolean indicating if the evaluation of all directives was successful.

public static bool GenerateFunctorSpecializations (Microsoft.Quantum.QsCompiler.SyntaxTree.QsCompilation compilation, out Microsoft.Quantum.QsCompiler.SyntaxTree.QsCompilation built, Action<Exception>? onException = default);
static member GenerateFunctorSpecializations : Microsoft.Quantum.QsCompiler.SyntaxTree.QsCompilation * QsCompilation * Action<Exception> -> bool
Public Function GenerateFunctorSpecializations (compilation As QsCompilation, ByRef built As QsCompilation, Optional onException As Action(Of Exception) = Nothing) As Boolean

Parameters

compilation
QsCompilation
onException
Action<Exception>

Returns

Boolean

Applies to