Skip to content

Commit

Permalink
Added an implicit conversion operator to OperableFunction, to elimina…
Browse files Browse the repository at this point in the history
…te a situation where the compiler complains due to ambiguity. Should probably also make several other similar additions to other operable types, but.. meh. Later.
  • Loading branch information
sdcondon committed Jul 23, 2024
1 parent e2f9ba2 commit ae46cb7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ internal OperableFunction(object identifier, IList<OperableTerm> arguments)
/// </summary>
/// <param name="function">The function to convert.</param>
public static implicit operator Function(OperableFunction function) => new(function.Identifier, function.Arguments.Select(a => (Term)a).ToArray());

/// <summary>
/// Implicitly converts an <see cref="OperableFunction"/> instance to an equivalent <see cref="Term"/>.
/// </summary>
/// <param name="function">The function to convert.</param>
public static implicit operator Term(OperableFunction function) => new Function(function.Identifier, function.Arguments.Select(a => (Term)a).ToArray());
}

/// <summary>
Expand Down

0 comments on commit ae46cb7

Please sign in to comment.