Skip to content

Commit efeeab4

Browse files
BooleanExpressionExtension.cs correction for multiple types within booleanExpressionSubject
1 parent f27d513 commit efeeab4

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

SysML2.NET/Extend/BooleanExpressionExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace SysML2.NET.Core.POCO.Kernel.Functions
2222
{
2323
using System;
2424
using System.Diagnostics.CodeAnalysis;
25+
using System.Linq;
2526

2627
/// <summary>
2728
/// The <see cref="BooleanExpressionExtensions" /> class provides extensions methods for
@@ -41,11 +42,9 @@ internal static class BooleanExpressionExtensions
4142
[ExcludeFromCodeCoverage]
4243
internal static IPredicate ComputePredicate(this IBooleanExpression booleanExpressionSubject)
4344
{
44-
// this method is a specialization of the method function from ExpressionExtensions.cs;
45-
// therefore, just return the function as a predicate; if no function, will return null;
4645
return booleanExpressionSubject == null
4746
? throw new ArgumentNullException(nameof(booleanExpressionSubject))
48-
: booleanExpressionSubject.ComputeFunction() as IPredicate;
47+
: booleanExpressionSubject.type.OfType<IPredicate>().FirstOrDefault();
4948
}
5049
}
5150
}

0 commit comments

Comments
 (0)