From d8e78054b9c4ceeca71057afd56354cf74ff2fd5 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 01:00:04 +0100 Subject: [PATCH 1/4] Enable nullable: System.Management.Automation.Language.ITypeName --- src/System.Management.Automation/engine/parser/ast.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index b654ab0ccdc..fee5273adf4 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -8107,6 +8107,8 @@ internal override object Accept(ICustomAstVisitor visitor) } } +#nullable enable + /// /// The name and attributes of a type. /// @@ -8155,6 +8157,8 @@ public interface ITypeName IScriptExtent Extent { get; } } +#nullable restore + internal interface ISupportsTypeCaching { Type CachedType { get; set; } From 4b553a91808e1cbf204972a454c050f34e0890ad Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 19:03:50 +0100 Subject: [PATCH 2/4] Removing whitespace before/after nullable pragma --- src/System.Management.Automation/engine/parser/ast.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index fee5273adf4..df26a3bba70 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -8108,7 +8108,6 @@ internal override object Accept(ICustomAstVisitor visitor) } #nullable enable - /// /// The name and attributes of a type. /// @@ -8156,7 +8155,6 @@ public interface ITypeName /// IScriptExtent Extent { get; } } - #nullable restore internal interface ISupportsTypeCaching From 31ee3434f391cf8f9ae339fef791d5a6100a9fa0 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 19:44:04 +0100 Subject: [PATCH 3/4] Removing whitespace before/after nullable pragma --- src/System.Management.Automation/engine/parser/ast.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index df26a3bba70..e0f54508091 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -8107,10 +8107,10 @@ internal override object Accept(ICustomAstVisitor visitor) } } -#nullable enable /// /// The name and attributes of a type. /// +#nullable enable public interface ITypeName { /// From 808e39ac1c06b88a00f6a46799d1f9d67a481e80 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 20:44:34 +0100 Subject: [PATCH 4/4] Correcting nullability for return values --- src/System.Management.Automation/engine/parser/ast.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index e0f54508091..86ac01457f7 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -8126,7 +8126,7 @@ public interface ITypeName /// /// The name of the assembly, if specified, otherwise null. /// - string AssemblyName { get; } + string? AssemblyName { get; } /// /// Returns true if the type names an array, false otherwise. @@ -8141,14 +8141,14 @@ public interface ITypeName /// /// Returns the that this typename represents, if such a type exists, null otherwise. /// - Type GetReflectionType(); + Type? GetReflectionType(); /// /// Assuming the typename is an attribute, returns the that this typename represents. /// By convention, the typename may omit the suffix "Attribute". Lookup will attempt to resolve the type as is, /// and if that fails, the suffix "Attribute" will be appended. /// - Type GetReflectionAttributeType(); + Type? GetReflectionAttributeType(); /// /// The extent of the typename.