Remove more orphaned code in Microsoft.CSharp (dotnet/corefx#27104)
authorJon Hanna <jon@hackcraft.net>
Thu, 15 Feb 2018 18:18:00 +0000 (18:18 +0000)
committerVladimir Sadov <vsadov@microsoft.com>
Thu, 15 Feb 2018 18:18:00 +0000 (10:18 -0800)
* Remove IExprWithObject and ExprWithArgs.OptionalObject

No longer used.

* Remove CLR_PostIncrement/Decrement

Rename CLR_PreIncrement/Decrement to CLR_Increment/Decrement as it
covers both pre- and post- cases.

* Remove Symbol.IsVirtual()

Commit migrated from https://github.com/dotnet/corefx/commit/0a61a146f78eb396d057eae9734d3f6e335d9a8b

src/libraries/Microsoft.CSharp/src/Microsoft.CSharp.csproj
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/BinderHelper.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/Symbol.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ExprWithArgs.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Field.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/IExprWithObject.cs [deleted file]
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/MemberGroup.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/SpecialNames.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/SymbolTable.cs

index cffe4fb..5438b70 100644 (file)
     <Compile Include="Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprWithType.cs" />
     <Compile Include="Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Field.cs" />
     <Compile Include="Microsoft\CSharp\RuntimeBinder\Semantics\Tree\FieldInfo.cs" />
-    <Compile Include="Microsoft\CSharp\RuntimeBinder\Semantics\Tree\IExprWithObject.cs" />
     <Compile Include="Microsoft\CSharp\RuntimeBinder\Semantics\Tree\List.cs" />
     <Compile Include="Microsoft\CSharp\RuntimeBinder\Semantics\Tree\LocalVariable.cs" />
     <Compile Include="Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MemberGroup.cs" />
index 6796eba..2123aea 100644 (file)
@@ -488,9 +488,9 @@ namespace Microsoft.CSharp.RuntimeBinder
                     return SpecialNames.CLR_False;
 
                 case ExpressionType.Increment:
-                    return SpecialNames.CLR_PreIncrement;
+                    return SpecialNames.CLR_Increment;
                 case ExpressionType.Decrement:
-                    return SpecialNames.CLR_PreDecrement;
+                    return SpecialNames.CLR_Decrement;
             }
         }
     }
index e9f0380..aa60a26 100644 (file)
@@ -191,28 +191,6 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
             return assem == sym.GetAssembly() || sym.InternalsVisibleTo(assem);
         }
 
-        /* Returns if the symbol is virtual. */
-        public bool IsVirtual()
-        {
-            switch (_kind)
-            {
-                case SYMKIND.SK_MethodSymbol:
-                    return ((MethodSymbol)this).isVirtual;
-
-                case SYMKIND.SK_EventSymbol:
-                    MethodSymbol methAdd = ((EventSymbol)this).methAdd;
-                    return methAdd != null && methAdd.isVirtual;
-
-                case SYMKIND.SK_PropertySymbol:
-                    PropertySymbol prop = ((PropertySymbol)this);
-                    MethodSymbol meth = prop.GetterMethod ?? prop.SetterMethod;
-                    return meth != null && meth.isVirtual;
-
-                default:
-                    return false;
-            }
-        }
-
         public bool IsOverride()
         {
             switch (_kind)
index eb81fcb..a91db12 100644 (file)
@@ -4,7 +4,7 @@
 
 namespace Microsoft.CSharp.RuntimeBinder.Semantics
 {
-    internal abstract class ExprWithArgs : ExprWithType, IExprWithObject
+    internal abstract class ExprWithArgs : ExprWithType
     {
         protected ExprWithArgs(ExpressionKind kind, CType type)
             : base(kind, type)
@@ -13,12 +13,6 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
 
         public ExprMemberGroup MemberGroup { get; set; }
 
-        public Expr OptionalObject
-        {
-            get => MemberGroup.OptionalObject;
-            set => MemberGroup.OptionalObject = value;
-        }
-
         public Expr OptionalArguments { get; set; }
 
         public abstract SymWithType GetSymWithType();
index 05d9c32..057ac3a 100644 (file)
@@ -4,7 +4,7 @@
 
 namespace Microsoft.CSharp.RuntimeBinder.Semantics
 {
-    internal sealed class ExprField : ExprWithType, IExprWithObject
+    internal sealed class ExprField : ExprWithType
     {
         public ExprField(CType type, Expr optionalObject, FieldWithType field)
             : base(ExpressionKind.Field, type)
diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/IExprWithObject.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/IExprWithObject.cs
deleted file mode 100644 (file)
index 9892988..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace Microsoft.CSharp.RuntimeBinder.Semantics
-{
-    internal interface IExprWithObject
-    {
-        Expr OptionalObject { get; set; }
-    }
-}
index 4c258c1..49e456b 100644 (file)
@@ -7,7 +7,7 @@ using Microsoft.CSharp.RuntimeBinder.Syntax;
 
 namespace Microsoft.CSharp.RuntimeBinder.Semantics
 {
-    internal sealed class ExprMemberGroup : ExprWithType, IExprWithObject
+    internal sealed class ExprMemberGroup : ExprWithType
     {
         public ExprMemberGroup(EXPRFLAG flags, Name name, TypeArray typeArgs, SYMKIND symKind, CType parentType, MethodOrPropertySymbol pMPS, Expr optionalObject, CMemberLookupResults memberLookupResults)
             : base(ExpressionKind.MemberGroup, MethodGroupType.Instance)
index a787b8a..d56b95a 100644 (file)
@@ -50,9 +50,7 @@ namespace Microsoft.CSharp.RuntimeBinder
         public const string CLR_True = "op_True";
         public const string CLR_False = "op_False";
 
-        public const string CLR_PreIncrement = "op_Increment";
-        public const string CLR_PostIncrement = "op_Increment";
-        public const string CLR_PreDecrement = "op_Decrement";
-        public const string CLR_PostDecrement = "op_Decrement";
+        public const string CLR_Increment = "op_Increment";
+        public const string CLR_Decrement = "op_Decrement";
     }
 }
index cd42b33..323f25b 100644 (file)
@@ -1973,8 +1973,8 @@ namespace Microsoft.CSharp.RuntimeBinder
                     case SpecialNames.CLR_OnesComplement:
                     case SpecialNames.CLR_True:
                     case SpecialNames.CLR_False:
-                    case SpecialNames.CLR_PreIncrement:
-                    case SpecialNames.CLR_PreDecrement:
+                    case SpecialNames.CLR_Increment:
+                    case SpecialNames.CLR_Decrement:
                         return true;
                 }
             }