[Mono-bugs] [Bug 80370][Cos] New - Compile fails due to missing body in constructor using a constructor chain

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Dec 26 16:50:35 EST 2006


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 j.heidenkamp at web.de.

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

--- shadow/80370	2006-12-26 16:50:34.000000000 -0500
+++ shadow/80370.tmp.1280	2006-12-26 16:50:34.000000000 -0500
@@ -0,0 +1,64 @@
+Bug#: 80370
+Product: Mono: Compilers
+Version: 1.1
+OS: other
+OS Details: Suse 10.1, ubuntu 6.10
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Cosmetic
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: j.heidenkamp at web.de               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compile fails due to missing body in constructor using a constructor chain
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+
+Steps to reproduce the problem:
+1. Code sample:
+
+using System;
+
+public class Test{
+
+    // next line causes compiler error
+    // public Test(string configPath):this(configPath,"");      
+    // this works 
+    public Test(string configPath):this(configPath, ""){
+        return;
+    }
+    public Test(string configPath, string appName){
+        // if ctor is called without appName set it to default
+        if(appName.Length == 0) appName = "default";
+
+        Console.WriteLine("{0}", appName);
+    }
+
+    public static void Main(){
+        Test test1 = new Test("foo");
+        Test test2 = new Test("foo","customparam");
+        return;
+    }
+}
+ 
+
+Actual Results:
+compiler gives error:
+error CS0501: `Test.Test(string)' must declare a body because it is not 
+marked abstract or extern
+
+Expected Results:
+successfull compile 
+
+
+How often does this happen? 
+always
+
+Additional Information:


More information about the mono-bugs mailing list