Bug 314021 (MONO55148) - [PATCH] Duplicate constructors getting compiled
Summary: [PATCH] Duplicate constructors getting compiled
Status: RESOLVED FIXED
Alias: MONO55148
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Ben Maurer
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2004-03-04 07:05 UTC by Sanjay Gupta
Modified: 2007-09-15 21:24 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Test script for the bug to be reproduced. (405 bytes, text/plain)
2004-03-04 07:06 UTC, Thomas Wiest
Details
patch (3.75 KB, patch)
2004-03-09 06:06 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:29:06 UTC


---- Reported by gsanjay@novell.com 2004-03-04 00:05:50 MST ----

Please fill in this template when reporting a bug, unless you know what you
are doing.
Description of Problem:
MCS compiler doesnot flags an error while compiling a library with two
similar constructors. 

Steps to reproduce the problem:
1. Compile the attached script with mcs -target:library classTest.cs
2. 
3. 

Actual Results:
Compilation succeeded

Expected Results:
Should throw an error stating duplicate constructor.

How often does this happen? 
Always

Additional Information:
Version for the compiler obtained through command 
mcs --version
Mono C# compiler version 0.30.99.0



---- Additional Comments From gsanjay@novell.com 2004-03-04 00:06:47 MST ----

Created an attachment (id=165695)
Test script for the bug to be reproduced.




---- Additional Comments From bmaurer@users.sf.net 2004-03-04 00:11:07 MST ----

You need a main method for this to compile, so here is a test we could
put in /errors

class T {
	T () {}
	T () {}
	static void Main () {}
}



---- Additional Comments From miguel@ximian.com 2004-03-04 13:50:36 MST ----

Ben, this sounds like a recently introduced regression;  Could you
verify if your code touched on this?

You also have been looking at this code recently, so you might be able
to help us.




---- Additional Comments From bmaurer@users.sf.net 2004-03-04 14:12:34 MST ----

Ok, basically the issue is that we need to have a CheckBase like 
thingy for the Constructor class. The code tries to use 
TypeManager.RegisterMethod to do the checking, however this function 
oddly always returns true. Maybe someone did a bug fix for the Method 
class, but did not move it over to Constructor.

Note to self: Also check indexers.




---- Additional Comments From bmaurer@users.sf.net 2004-03-08 23:06:28 MST ----

Created an attachment (id=165696)
patch




---- Additional Comments From bmaurer@users.sf.net 2004-03-08 23:07:33 MST ----

Very simple patch, just copy & paste from the method case to check for
dup overloads.



---- Additional Comments From bmaurer@users.sf.net 2004-03-08 23:16:59 MST ----

Before, we were trying to call RegisterMethod to do the validation,
however this method just returns true. We have to do the checking
ourselfs.

So, I overrode CheckBase and did the validation there. A few other
validation items were moved up as well (for consistancy).



---- Additional Comments From bmaurer@users.sf.net 2004-03-09 08:05:55 MST ----

Lets get this bug metadata'd up



---- Additional Comments From bmaurer@users.sf.net 2004-03-11 17:25:13 MST ----

Fixed in CVS.

Imported an attachment (id=165695)
Imported an attachment (id=165696)

Unknown operating system unknown. Setting to default OS "Other".