Skip to content

Commit 90b6e69

Browse files
Add support for -not and -as
Forgot to put in support for `-not`, and `-as` was throwing a NRE because of a method resolution error on my part.
1 parent 62b9094 commit 90b6e69

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/PSLambda/CompileVisitor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@ public object VisitUnaryExpression(UnaryExpressionAst unaryExpressionAst)
916916
return Assign(child, Increment(child));
917917
case TokenKind.PostfixMinusMinus:
918918
return Assign(child, Decrement(child));
919+
case TokenKind.Not:
920+
return Not(PSIsTrue(child));
919921
default:
920922
ReportNotSupported(
921923
unaryExpressionAst.Extent,

src/PSLambda/ReflectionCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ internal static class ReflectionCache
6161
var parameters = method.GetParameters();
6262
return parameters.Length == 2
6363
&& parameters[0].ParameterType == typeof(object)
64-
&& parameters[1].ParameterType.IsGenericParameter;
64+
&& parameters[1].ParameterType.IsByRef;
6565
},
6666
null)
6767
.FirstOrDefault();

0 commit comments

Comments
 (0)