Skip to content

Commit 9bd8a27

Browse files
adityapatwardhankilasuit
authored andcommitted
Implement Null Coalescing and Null Coalescing assignment operators (PowerShell#10636)
1 parent 3c59b4e commit 9bd8a27

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ static ExperimentalFeature()
120120
description: "New formatting for ErrorRecord"),
121121
new ExperimentalFeature(
122122
name: "PSUpdatesNotification",
123-
description: "Print notification message when new releases are available")
123+
description: "Print notification message when new releases are available"),
124+
new ExperimentalFeature(
125+
name: "PSCoalescingOperators",
126+
description: "Support the null coalescing operator and null coalescing assignment operator in PowerShell language")
124127
};
125128
EngineExperimentalFeatures = new ReadOnlyCollection<ExperimentalFeature>(engineFeatures);
126129

src/System.Management.Automation/engine/parser/Compiler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ internal static class CachedReflectionInfo
279279
typeof(InterpreterError).GetMethod(nameof(InterpreterError.NewInterpreterExceptionWithInnerException), StaticFlags);
280280

281281
internal static readonly MethodInfo LanguagePrimitives_GetInvalidCastMessages =
282-
typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.GetInvalidCastMessages), StaticFlags);
282+
typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.GetInvalidCastMessages), staticFlags);
283283
internal static readonly MethodInfo LanguagePrimitives_IsNullLike =
284-
typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.IsNullLike), StaticPublicFlags);
284+
typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.IsNullLike), staticPublicFlags);
285285
internal static readonly MethodInfo LanguagePrimitives_ThrowInvalidCastException =
286286
typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.ThrowInvalidCastException), StaticFlags);
287287

src/System.Management.Automation/engine/parser/token.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,8 @@ public static class TokenTraits
10631063
/* Shr */ "-shr",
10641064
/* Colon */ ":",
10651065
/* QuestionMark */ "?",
1066-
/* Reserved slot 3 */ string.Empty,
1067-
/* Reserved slot 4 */ string.Empty,
1066+
/* QuestionQuestionEquals */ "??=",
1067+
/* QuestionQuestion */ "??",
10681068
/* Reserved slot 5 */ string.Empty,
10691069
/* Reserved slot 6 */ string.Empty,
10701070
/* Reserved slot 7 */ string.Empty,

0 commit comments

Comments
 (0)