[Mono-bugs] [Bug 67171][Maj] New - An Optional parameter must specify a constant expression to be used a replacement value if no argument is specified.When you omit one or more optional arguments in the argument list, you use successive commas to mark their positions

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 30 Sep 2004 02:08:57 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by manishkumarsinha@sify.com.

http://bugzilla.ximian.com/show_bug.cgi?id=67171

--- shadow/67171	2004-09-30 02:08:57.000000000 -0400
+++ shadow/67171.tmp.25372	2004-09-30 02:08:57.000000000 -0400
@@ -0,0 +1,83 @@
+Bug#: 67171
+Product: Mono: Compilers
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Basic
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: manishkumarsinha@sify.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: An Optional parameter must specify a constant expression to be used a replacement value if no argument is specified.When you omit one or more optional arguments in the argument list, you use successive commas to mark their positions
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:An Optional parameter must specify a constant 
+expression to be used a replacement value if no argument is specified.When 
+you omit one or more optional arguments in the argument list, you use 
+successive commas to mark their positions.
+
+
+Steps to reproduce the problem:
+1. 
+
+Imports System
+Module OP1_0_0
+	Function F(ByVal telephoneNo as Long, Optional ByVal code as 
+Integer = 080,Optional ByVal code1  As Integer = 091, Optional ByRef name 
+As String="Sinha") As Boolean
+		if (code <> 080 and code1 <> 091 and name="Sinha")
+			return false
+		else 
+			return true
+		end if
+   	End Function 
+   
+   Sub Main()
+      Dim telephoneNo As Long = 9886066432
+	Dim name As String ="Manish"
+	Dim status as Boolean
+      status = F(telephoneNo,,,name)
+	if(status = false)
+		Throw New System.Exception("#A1, Unexcepted behaviour in 
+string of OP1_0_1")
+	end if
+   End Sub 
+
+End Module
+2. Imports System
+Module OP1_0_0
+	Sub F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 
+080,Optional ByVal code1  As Integer = 091, Optional ByRef name As 
+String="Sinha")
+		if (code <> 080 and code1 <> 091 and name="Sinha")
+			Throw New System.Exception("#A1, Unexcepted 
+behaviour in string of OP1_0_0")
+		end if
+   	End Sub 
+   
+   Sub Main()
+      Dim telephoneNo As Long = 9886066432
+	Dim name As String ="Manish"
+      F(telephoneNo,,,name)
+   End Sub 
+
+End Module
+3. 
+
+Actual Results:Failed compilation
+
+
+Expected Results:It must successfully compiled
+
+
+How often does this happen? 
+
+
+Additional Information: