Author: sudha
Date: 2005-07-14 23:53:44 -0400 (Thu, 14 Jul 2005)
New Revision: 47324
Added:
trunk/mcs/mbas/Test/tests/typemembers/PropertyK.vb
Modified:
trunk/mcs/mbas/Test/tests/typemembers/PropertyF.vb
Log:
Testcases for properties
Modified: trunk/mcs/mbas/Test/tests/typemembers/PropertyF.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/typemembers/PropertyF.vb 2005-07-15 03:30:56 UTC
(rev 47323)
+++ trunk/mcs/mbas/Test/tests/typemembers/PropertyF.vb 2005-07-15 03:53:44 UTC
(rev 47324)
@@ -3,11 +3,19 @@
'
' (C) 2005 Novell, Inc.
'
-' Properties taking arguments
+' Properties taking arguments, overloading of properties
Imports System
Module M
Dim a As Integer() = {1,2,3}
+ Property Prop (ByVal i As Integer, ByVal j As Integer) As Integer
+ Get
+ return a(i)
+ End Get
+ Set
+ a (i) = Value
+ End Set
+ End Property
Property Prop (ByVal i As Integer) As Integer
Get
return a(i)
Added: trunk/mcs/mbas/Test/tests/typemembers/PropertyK.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/typemembers/PropertyK.vb 2005-07-15 03:30:56 UTC
(rev 47323)
+++ trunk/mcs/mbas/Test/tests/typemembers/PropertyK.vb 2005-07-15 03:53:44 UTC
(rev 47324)
@@ -0,0 +1,37 @@
+'Author:
+' Satya Sudha K ([EMAIL PROTECTED])
+'
+' (C) 2005 Novell, Inc.
+'
+' Two overloaded and applicable properties
+
+Imports System
+Module M
+ Class C
+ Dim a() As Integer = {7, 8, 9}
+ Property Prop As Integer()
+ Get
+ throw new Exception ("Should not come here")
+ End Get
+ Set
+ throw new Exception ("Should not come here")
+ End Set
+ End Property
+ Property Prop (ByVal i As Integer) As Integer
+ Get
+ return a(i)
+ End Get
+ Set
+ a (i) = Value
+ End Set
+ End Property
+ End Class
+
+ Sub Main ()
+ Dim c1 As new C()
+ c1.Prop (2) = 1
+ if (c1.Prop (2) <> 1)
+ Throw new Exception ("A#1 Properties not working with
arguments.")
+ End If
+ End Sub
+End Module
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches