From 71e3c8a703e6fb0b0f3b51486b8a33c143778f47 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Thu, 19 Nov 2020 23:22:57 +0100 Subject: [PATCH 1/3] Enable nullable: System.Management.Automation.Language.IScriptPosition --- src/System.Management.Automation/engine/parser/Position.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index 24ce0d118a2..ad7c3cc7f09 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -12,6 +12,7 @@ namespace System.Management.Automation.Language { #region Public Interfaces +#nullable enable /// /// Represents a single point in a script. The script may come from a file or interactive input. /// @@ -20,7 +21,7 @@ public interface IScriptPosition /// /// The name of the file, or if the script did not come from a file, then null. /// - string File { get; } + string? File { get; } /// /// The line number of the position, with the value 1 being the first line. @@ -45,9 +46,11 @@ public interface IScriptPosition /// /// The complete script that this position is included in. /// - string GetFullScript(); + string? GetFullScript(); } +#nullable restore + /// /// Represents the a span of text in a script. /// From 2c745242d1d652d91b35959a257063bcb2d82be1 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 19:03:36 +0100 Subject: [PATCH 2/3] Removing whitespace before/after nullable pragma --- src/System.Management.Automation/engine/parser/Position.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index ad7c3cc7f09..13937d72a42 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -48,7 +48,6 @@ public interface IScriptPosition /// string? GetFullScript(); } - #nullable restore /// From a2e8320960315cbb987d265f39f22ea8cc1267dc Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 19:43:31 +0100 Subject: [PATCH 3/3] Removing whitespace before/after nullable pragma --- src/System.Management.Automation/engine/parser/Position.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index 13937d72a42..66118cc619c 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -12,10 +12,10 @@ namespace System.Management.Automation.Language { #region Public Interfaces -#nullable enable /// /// Represents a single point in a script. The script may come from a file or interactive input. /// +#nullable enable public interface IScriptPosition { ///