Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Remove dead code from Microsoft.VisualBasic (#24664)
Browse files Browse the repository at this point in the history
* Deleted dead code from Microsoft.VisualBasic

* Deleted unnecessary commit.
  • Loading branch information
satano authored and danmoseley committed Oct 18, 2017
1 parent f757a32 commit b290e3f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
Return method.GetGenericArguments
End Function

Friend Shared Function GetTypeParameters(ByVal type As Type) As Type()
Debug.Assert(type.GetGenericTypeDefinition Is Nothing, "expected unbound generic type")
Return type.GetGenericArguments
End Function

Friend Shared Function GetTypeArguments(ByVal type As Type) As Type()
Debug.Assert(type.GetGenericTypeDefinition IsNot Nothing, "expected bound generic type")
Return type.GetGenericArguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ Namespace Microsoft.VisualBasic.CompilerServices

Friend Const OptionCompareTextFlags As CompareOptions = (CompareOptions.IgnoreCase Or CompareOptions.IgnoreWidth Or CompareOptions.IgnoreKanaType)

' DON'T ACCESS DIRECTLY! Go through the property below
Private Shared s_VBAResourceManager As System.Resources.ResourceManager
Private Shared s_triedLoadingResourceManager As Boolean
Private Shared ReadOnly s_resourceManagerSyncObj As Object = New Object

Friend Shared m_achIntlSpace() As Char = {chSpace, chIntlSpace}
Expand Down Expand Up @@ -79,7 +76,7 @@ Namespace Microsoft.VisualBasic.CompilerServices
' This one is exposed because I have to be able to get at localized error
' strings from the MY template
' Param: ID - Identifier for the string to be retrieved
' Param: Args - An array of params used to replace placeholders.
' Param: Args - An array of params used to replace placeholders.
'Returns: The resource string if found or an error message string
'*****************************************************************************
Public Shared Function GetResourceString(ByVal resourceKey As String, ByVal ParamArray args() As String) As String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,11 @@ Namespace Global.Microsoft.VisualBasic.CompilerServices

Friend Module ReflectionExtensions

<System.Runtime.CompilerServices.ExtensionAttribute()>
Public Function MemberType(ByVal memberInfo As MemberInfo) As MemberTypes
If TypeOf memberInfo Is ConstructorInfo Then
Return MemberTypes.Constructor
ElseIf TypeOf memberInfo Is MethodInfo Then
Return MemberTypes.Method
ElseIf TypeOf memberInfo Is PropertyInfo Then
Return MemberTypes.Property
ElseIf TypeOf memberInfo Is FieldInfo Then
Return MemberTypes.Field
ElseIf TypeOf memberInfo Is EventInfo Then
Return MemberTypes.Event
ElseIf TypeOf memberInfo Is System.Reflection.TypeInfo Then
Return MemberTypes.TypeInfo
Else
Throw New System.ArgumentException
End If
End Function

<System.Runtime.CompilerServices.ExtensionAttribute()>
Public Function GetTypeCode(type As Type) As TypeCode
Return Type.GetTypeCode(type)
End Function

<System.Runtime.CompilerServices.ExtensionAttribute()>
Public Function IsSubclassOf(source As Type, other As Type) As Boolean
Return source.IsSubclassOf(other)
End Function

Public ReadOnly Property BindingFlagsInvokeMethod As BindingFlags
Get
Return CType(256, BindingFlags) ' BindingFlags.InvokeMethod
Expand Down Expand Up @@ -334,7 +310,7 @@ Namespace Global.Microsoft.VisualBasic.CompilerServices
' fallback to "IsEquivalentTo"
Dim fallbackMemberEquivalence As Func(Of MethodBase, MethodBase, Boolean) = Function(m1param, m2param) m1param.IsEquivalentTo(m2param)

' fallback must work
' fallback must work
s_MemberEquivalence = fallbackMemberEquivalence
Return fallbackMemberEquivalence(m1, m2)
End Function
Expand Down

0 comments on commit b290e3f

Please sign in to comment.