From 525dcfeacb3d89f7fcabeef4adfdf9650ed68127 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 14 Nov 2019 01:33:39 +0500 Subject: [PATCH] Remove the unused type converter for `CommaDelimitedStringCollection` (#11000) --- .../engine/LanguagePrimitives.cs | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 9de469b6c7..c097ead06b 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -2426,23 +2426,7 @@ namespace System.Management.Automation valueToConvert.ToString(), resultType.ToString(), wmiClassException.Message); } } -#endif - // System.Configuration.CommaDelimitedStringCollection is derived from the StringCollection class - private static System.Configuration.CommaDelimitedStringCollection ConvertToCommaDelimitedStringCollection(object valueToConvert, - Type resultType, - bool recursion, - PSObject originalValueToConvert, - IFormatProvider formatProvider, - TypeTable backupTable) - { - typeConversion.WriteLine("Standard type conversion to a CommaDelimitedStringCollection."); - var commaDelimitedStringCollection = new System.Configuration.CommaDelimitedStringCollection(); - AddItemsToCollection(valueToConvert, resultType, formatProvider, backupTable, commaDelimitedStringCollection); - return commaDelimitedStringCollection; - } - -#if !UNIX private static DirectoryEntry ConvertToADSI(object valueToConvert, Type resultType, bool recursion, @@ -5006,14 +4990,6 @@ namespace System.Management.Automation return CacheConversion(fromType, toType, LanguagePrimitives.ConvertToStringCollection, rank); } -#if !CORECLR // No CommaDelimitedStringCollection In CoreCLR - if (toType == typeof(System.Configuration.CommaDelimitedStringCollection)) - { - ConversionRank rank = (fromType.IsArray || IsTypeEnumerable(fromType)) ? ConversionRank.Language : ConversionRank.LanguageS2A; - return CacheConversion(fromType, toType, LanguagePrimitives.ConvertToCommaDelimitedStringCollection, rank); - } -#endif - if (toType.IsSubclassOf(typeof(System.Delegate)) && (fromType == typeof(ScriptBlock) || fromType.IsSubclassOf(typeof(ScriptBlock)))) {