Hi,

This patch adds two extra tests that currently fail in mbas and show
bugs in the parsing code. They succeed on Visual Basic.NET. 

I've been working on a fix for these on and off for the past few months, but I 
never got around to actually fixing them. I still plan to, but I'm not
sure when.

Cheers,

Jelmer

-- 
Jelmer Vernooij <[EMAIL PROTECTED]> - http://jelmer.vernstok.nl/
 10:18:00 up 94 days, 23:22,  5 users,  load average: 0.00, 0.06, 0.08
Index: Test/tests/typemembers/EventP.vb
===================================================================
--- Test/tests/typemembers/EventP.vb    (revision 0)
+++ Test/tests/typemembers/EventP.vb    (revision 0)
@@ -0,0 +1,42 @@
+'To see if AddHandler supports non-AddressOf arguments
+
+Imports System
+
+Class C
+    Public Event E As EventHandler
+
+    Public Sub S()
+        RaiseEvent E(Me, EventArgs.Empty)
+    End Sub
+End Class
+
+Class C1
+    Dim x As C = New C
+
+    Sub setHandler()
+        AddHandler x.E, New EventHandler(AddressOf xh)
+    End Sub
+
+    Sub unsetHandler()
+        RemoveHandler x.E, New EventHandler(AddressOf xh)
+    End Sub
+
+    Sub call_S()
+        x.S()
+    End Sub
+
+    Sub xh(ByVal sender As Object, ByVal e As EventArgs)
+        Console.WriteLine("event called")
+    End Sub
+End Class
+
+Module M
+    Sub Main()
+        Dim y As New C1
+        y.setHandler()
+        y.call_S()
+        y.unsetHandler()
+        y.call_S()
+    End Sub
+
+End Module
Index: Test/tests/typemembers/EventO.vb
===================================================================
--- Test/tests/typemembers/EventO.vb    (revision 0)
+++ Test/tests/typemembers/EventO.vb    (revision 0)
@@ -0,0 +1,22 @@
+'To Check if WithEvents members can appear after they are used by 
+'Handles clauses
+
+Imports System
+
+Class Raiser
+    Public Event Fun(ByVal i as Integer)
+    Public Sub New(i as Integer)
+        RaiseEvent Fun(23)
+    End Sub
+End Class
+
+Module Test
+    Private Sub Fun(ByVal i as integer) Handles x.Fun
+    End Sub
+
+    Private WithEvents x As Raiser
+    
+    Public Sub Main()
+        x = New Raiser(10)
+    End Sub
+End Module
Index: class.cs
===================================================================
--- class.cs    (revision 55972)
+++ class.cs    (working copy)
@@ -83,7 +83,7 @@
                // Holds the events
                ArrayList events;
 
-               // Holds AddHandlers stements for events
+               // Holds AddHandlers statements for events
                ArrayList handlers;
 
                // The emit context for toplevel objects.
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 55972)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2006-01-23 Jelmer Vernooij <[EMAIL PROTECTED]>
+       * Test/tests/typemembers/EventP.vb: Add tests that check for 
+       more complex constructions in AddHandler / RemoveHandler.
+       * Test/tests/typemembers/EventO.vb: Test for parsing a WITHEVENTS 
+       variable declaration after it is being used in a 'Handles ...' clause.
+
 2005-12-21 Maverson Eduardo Schulze Rosa <[EMAIL PROTECTED]>
        * ecore.cs, cfold.cs: Changed for reflecting correct Error 
Number/Message with
        Implict Convertions when Option Strict is On.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Mono-vb mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-vb

Reply via email to