Author: sashak
Date: 2007-05-10 08:27:29 -0400 (Thu, 10 May 2007)
New Revision: 77125

Modified:
   
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinder.vb
Log:
CompareSignature() bug fix.
Basic enum types handling in CompareTypes()

Modified: 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinder.vb
===================================================================
--- 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinder.vb
       2007-05-10 12:11:28 UTC (rev 77124)
+++ 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinder.vb
       2007-05-10 12:27:29 UTC (rev 77125)
@@ -100,6 +100,7 @@
                                                 ByVal names() As String, _
                                                 ByRef state As Object) As 
System.Reflection.MethodBase
 
+
             state = GetStateInstance()
             CType(state, BState).oargs = CType(args.Clone(), Object())
 
@@ -126,7 +127,7 @@
                         End If
                     End If
                 Else
-                    If Not names Is Nothing Then ' thre are name matches but 
not parameter matches
+                    If Not names Is Nothing Then ' there are name matches but 
not parameter matches
                         Throw New AmbiguousMatchException
                     End If
                 End If
@@ -980,6 +981,10 @@
                     current = CompareTypes(type1, type2, 
IsParamArray(parameters, i))
                 End If
 
+                If current = TypeConversion.NotConvertible Then
+                    Return current
+                End If
+
                 If i = 0 Then
                     previous = current
                 Else
@@ -1035,6 +1040,12 @@
             Dim typeCode1 As TypeCode = Type.GetTypeCode(type1)
             Dim typeCode2 As TypeCode = Type.GetTypeCode(type2)
 
+            If type1.IsPrimitive And type2.IsEnum Then
+                Return TypeConversion.Narrowing
+            ElseIf type1.IsEnum And type2.IsPrimitive Then
+                Return TypeConversion.Widening
+            End If
+
             If type1.IsPrimitive And type2.IsPrimitive Then
 
                 If typeCode1 = TypeCode.Char Or typeCode2 = TypeCode.Char Then

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to