From 99d2096a9bd486e8bc97a23f9bfca943d6705e1b Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 00:45:51 +0100 Subject: [PATCH 1/3] Enable nullable: System.Management.Automation.Language.IScriptExtent --- src/System.Management.Automation/engine/parser/Position.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index 24ce0d118a2..306a8f70ed5 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -48,6 +48,8 @@ public interface IScriptPosition string GetFullScript(); } +#nullable enable + /// /// Represents the a span of text in a script. /// @@ -56,7 +58,7 @@ public interface IScriptExtent /// /// The filename the extent includes, or null if the extent is not included in any file. /// - string File { get; } + string? File { get; } /// /// The starting position of the extent. @@ -104,6 +106,8 @@ public interface IScriptExtent int EndOffset { get; } } +#nullable restore + /// /// A few utility functions for script positions. /// From edd1aed081e7e5632c79bc5e3fdc06e6971385b0 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 19:03:30 +0100 Subject: [PATCH 2/3] Removing whitespace before/after nullable pragma --- src/System.Management.Automation/engine/parser/Position.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index 306a8f70ed5..1fc8cd14d37 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -49,7 +49,6 @@ public interface IScriptPosition } #nullable enable - /// /// Represents the a span of text in a script. /// @@ -105,7 +104,6 @@ public interface IScriptExtent /// int EndOffset { get; } } - #nullable restore /// From 274a33710b1c02e504d38fb11631a9e958d6c50d Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 19:43:10 +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 1fc8cd14d37..5e967e432b6 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -48,10 +48,10 @@ public interface IScriptPosition string GetFullScript(); } -#nullable enable /// /// Represents the a span of text in a script. /// +#nullable enable public interface IScriptExtent { ///