Author: sudha
Date: 2005-05-24 07:01:38 -0400 (Tue, 24 May 2005)
New Revision: 44926
Added:
trunk/mcs/mbas/Test/errors/ExpressionOverLoadMethodA.vb
trunk/mcs/mbas/Test/tests/latebinding/ExpressionOverLoadMethodB.vb
trunk/mcs/mbas/Test/tests/latebinding/ExpressionOverLoadMethodC.vb
trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodA.vb
trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodB.vb
trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodC.vb
Modified:
trunk/mcs/mbas/Test/ChangeLog
Log:
Testcases for overload resolution involving 'object' arguments
Modified: trunk/mcs/mbas/Test/ChangeLog
===================================================================
--- trunk/mcs/mbas/Test/ChangeLog 2005-05-24 10:28:19 UTC (rev 44925)
+++ trunk/mcs/mbas/Test/ChangeLog 2005-05-24 11:01:38 UTC (rev 44926)
@@ -1,3 +1,6 @@
+2005-05-24 Satya Sudha K <[EMAIL PROTECTED]>
+ * Testcases for overload resolution involving 'object' arguments
+
2005-05-17 Satya Sudha K <[EMAIL PROTECTED]>
Sudharsan V <[EMAIL PROTECTED]>
* Testcases for named arguments and typemembers
Added: trunk/mcs/mbas/Test/errors/ExpressionOverLoadMethodA.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/ExpressionOverLoadMethodA.vb 2005-05-24
10:28:19 UTC (rev 44925)
+++ trunk/mcs/mbas/Test/errors/ExpressionOverLoadMethodA.vb 2005-05-24
11:01:38 UTC (rev 44926)
@@ -0,0 +1,20 @@
+'Author: Satya Sudha K <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+REM LineNo: 18
+REM ExpectedError: BC30519
+REM ErrorMessage: Overload resolution failed because no accessible 'F' can be
called without a narrowing conversion
+
+Imports System
+Module M
+ Function F (a As Long, b As Integer) As Integer
+ return 1
+ End Function
+ Function F (a As String, b As Short) As Integer
+ return 2
+ End Function
+ Sub Main ()
+ Dim obj As Object = "ABC"
+ Dim b As Long = 345
+ F (obj, b)
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/latebinding/ExpressionOverLoadMethodB.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/latebinding/ExpressionOverLoadMethodB.vb
2005-05-24 10:28:19 UTC (rev 44925)
+++ trunk/mcs/mbas/Test/tests/latebinding/ExpressionOverLoadMethodB.vb
2005-05-24 11:01:38 UTC (rev 44926)
@@ -0,0 +1,21 @@
+'Author:
+' Satya Sudha K ([EMAIL PROTECTED])
+'
+' (C) 2005 Novell, Inc.
+
+Imports System
+
+Module M
+ Function F (a As Long) As Integer
+ return 1
+ End Function
+ Function F (a As String) As Integer
+ return 2
+ End Function
+ Sub Main ()
+ Dim obj As Object = "ABC"
+ if F (obj) <> 2 Then
+ throw new Exception ("Overload Resolution failed in
latebinding")
+ End If
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/latebinding/ExpressionOverLoadMethodC.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/latebinding/ExpressionOverLoadMethodC.vb
2005-05-24 10:28:19 UTC (rev 44925)
+++ trunk/mcs/mbas/Test/tests/latebinding/ExpressionOverLoadMethodC.vb
2005-05-24 11:01:38 UTC (rev 44926)
@@ -0,0 +1,21 @@
+'Author:
+' Satya Sudha K ([EMAIL PROTECTED])
+'
+' (C) 2005 Novell, Inc.
+
+Imports System
+
+Module M
+ Function F (a As Long, b As Integer, c As Long) As Integer
+ return 1
+ End Function
+ Function F (a As String, b as Long, c As Integer) As Integer
+ return 2
+ End Function
+ Sub Main ()
+ Dim obj As Object = "ABC"
+ if F (obj,1,2) <> 2 Then
+ throw new Exception ("Overload Resolution failed in
latebinding")
+ End If
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodA.vb
2005-05-24 10:28:19 UTC (rev 44925)
+++ trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodA.vb
2005-05-24 11:01:38 UTC (rev 44926)
@@ -0,0 +1,24 @@
+'Author:
+' Satya Sudha K ([EMAIL PROTECTED])
+'
+' (C) 2005 Novell, Inc.
+'
+' Since the argument is of type object, the first method should be invoked
irrespective of the
+' runtime type of the object
+
+Imports System
+
+Module M
+ Function F (a As Object) As Integer
+ return 1
+ End Function
+ Function F (a As String) As Integer
+ return 2
+ End Function
+ Sub Main ()
+ Dim obj As Object = "ABC"
+ if F (obj) <> 1 Then
+ throw new Exception ("Overload Resolution failed in
latebinding")
+ End If
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodB.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodB.vb
2005-05-24 10:28:19 UTC (rev 44925)
+++ trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodB.vb
2005-05-24 11:01:38 UTC (rev 44926)
@@ -0,0 +1,19 @@
+'Author:
+' Satya Sudha K ([EMAIL PROTECTED])
+'
+' (C) 2005 Novell, Inc.
+'
+' Since there is only one applicable method, no late binding is involved
+
+Imports System
+Module M
+ Function F (a As String) As Integer
+ return 2
+ End Function
+ Sub Main ()
+ Dim obj As Object = "ABC"
+ if F (obj) <> 1 Then
+ throw new Exception ("Overload Resolution failed in
latebinding")
+ End If
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodC.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodC.vb
2005-05-24 10:28:19 UTC (rev 44925)
+++ trunk/mcs/mbas/Test/tests/typemembers/ExpressionOverLoadMethodC.vb
2005-05-24 11:01:38 UTC (rev 44926)
@@ -0,0 +1,21 @@
+'Author:
+' Satya Sudha K ([EMAIL PROTECTED])
+'
+' (C) 2005 Novell, Inc.
+
+Imports System
+
+Module M
+ Function F (a As Long, b As Integer, c As Long) As Integer
+ return 1
+ End Function
+ Function F (a As String, b as Date, c As Integer) As Integer
+ return 2
+ End Function
+ Sub Main ()
+ Dim obj As Object = "123"
+ if F (obj,1,2) <> 1 Then
+ throw new Exception ("Overload Resolution failed in
latebinding")
+ End If
+ End Sub
+End Module
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches