bugDotGNU Portable.NET - Bugs: bug #2107, cscc does not resolve overloaded...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #2107: cscc does not resolve overloaded operator

Submitted by:  Marcus Urban <mathpup>
Submitted on:  Thu 02 Jan 2003 10:11:22 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Wed 26 Feb 2003 06:35:21 AM UTC, comment #6:

Fix committed - 26 Feb 2003

Rhys Weatherley <rweather>
Project Administrator
Thu 23 Jan 2003 10:01:56 PM UTC, comment #5:

Found the bug,
the source code does not define a conversion from int.
public static Integer operator + ( Integer a, int b )
{
return new Integer( a.data + (int) b );
}

That error message needs to say that there is a signed problem, and that you need to add an int overloaded function.

mike

James Michael DuPont <mdupont>
Thu 23 Jan 2003 08:27:25 AM UTC, comment #4:

I have removed the #line directives from cs_semantics.c
because the debugged does not like them.

I tell you, the GetIndirectConvertRules is way to complex
it needs to be cleaned up! I think that would be a good start for me.

the parameters are :
{programItem = {image = 0x8112920, token = 33554434, linked = 0, attrsOrLink = 0x0}, attributes = 1, name = 0x8113548 "Integer", namespace = 0x0, parent = 0x400120cc, implements = 0x0, firstMember = 0x4001218c, lastMember = 0x4001220c, nestedChildren = 0x0, scope = 0x40012004, synthetic = 0x0, ext = 0x0, userData = 0x8171710}

the second one
{programItem = {image = 0x8112920, token = 16777218, linked = 1, attrsOrLink = 0x40012374}, attributes = 2147483648,
<mdupont> name = 0x811357a "Int32", namespace = 0x8113541 "System", parent = 0x0, implements = 0x0, firstMember = 0x0, lastMember = 0x0, nestedChildren = 0x0, scope = 0x40012094, synthetic = 0x0, ext = 0x0, userData = 0x0}

you can see,

arg1 is Integer, arg2 to is Int32,
not a uint as in the code.

back trace (with line numbers)

#0 GetIndirectConvertRules (info=0x8110720, fromType=0x8171960, toType=0x21, explicit=1073815830, kinds=1, rules1=0x80d616f,
rules2=0x40012116, itype1=0x21, itype2=0x8171b34) at cg_coerce.c:548
#1 0x0805110e in ILNode_SemAnalysis_94__ (node=0x8171980, info=0x8110720, parent=0x81719ac) at cs_semantics.c:5801
#2 0x080566d4 in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0x40017094) at cs_semantics.c:9786
#3 0x080577c7 in CSSemExpectValue (node=0x8171980, info=0x8110720, parent=0x81719ac, value=0xbffff520) at cs_semantics.c:11112
#4 0x080518f0 in ILNode_SemAnalysis_109__ (node=0x8171998, info=0x8110720, parent=0xbffff5cc) at cs_semantics.c:6084
#5 0x080567de in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0xc4) at cs_semantics.c:9876
#6 0x0804d332 in StmtSem (node=0x8171998, info=0x8110720, parent=0xbffff5cc) at cs_semantics.c:3227
#7 0x08053249 in ILNode_SemAnalysis_152__ (node=0x8171ac8, info=0x8110720, parent=0xbffff66c) at cs_semantics.c:7067
#8 0x08056e28 in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0xc4) at cs_semantics.c:10135
#9 0x0804d332 in StmtSem (node=0x8171ac8, info=0x8110720, parent=0xbffff66c) at cs_semantics.c:3227
#10 0x08053249 in ILNode_SemAnalysis_152__ (node=0x8171af0, info=0x8110720, parent=0x8171b2c) at cs_semantics.c:7067
#11 0x08056e28 in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0xc4) at cs_semantics.c:10135
#12 0x0804d332 in StmtSem (node=0x8171af0, info=0x8110720, parent=0x8171b2c) at cs_semantics.c:3227
#13 0x08054396 in ILNode_SemAnalysis_172__ (node=0x8171b18, info=0x8110720, parent=0x8171b5c) at cs_semantics.c:7746
#14 0x08056d9c in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0xc4) at cs_semantics.c:10255
#15 0x08055822 in ILNode_SemAnalysis_192__ (node=0x8171b34, info=0x8110720, parent=0xbffff80c) at cs_semantics.c:8685
#16 0x08056eec in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0xc4) at cs_semantics.c:10375
#17 0x0804d332 in StmtSem (node=0x8171b34, info=0x8110720, parent=0xbffff80c) at cs_semantics.c:3227
#18 0x08053249 in ILNode_SemAnalysis_152__ (node=0x8171b6c, info=0x8110720, parent=0x8171d30) at cs_semantics.c:7067
#19 0x08056e28 in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0xc4) at cs_semantics.c:10135
#20 0x08055145 in ILNode_SemAnalysis_187__ (node=0x6, info=0x8110720, parent=0x8171cac) at cs_semantics.c:8310
#21 0x08056ea6 in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0xc4) at cs_semantics.c:10345
#22 0x08054eb5 in ILNode_SemAnalysis_186__ (node=0x8171c80, info=0x8110720, parent=0xbffff9cc) at cs_semantics.c:8205
#23 0x08056e98 in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0xc4) at cs_semantics.c:10339
#24 0x0804d332 in StmtSem (node=0x8171c80, info=0x8110720, parent=0xbffff9cc) at cs_semantics.c:3227
#25 0x08053249 in ILNode_SemAnalysis_152__ (node=0x8171d34, info=0x8110720, parent=0x81107f0) at cs_semantics.c:7067
#26 0x08056e28 in ILNode_SemAnalysis (node__=0x6, info=0x8110720, parent=0xc4) at cs_semantics.c:10135
#27 0x080493f9 in CCPluginSemAnalysis () at cs_main.c:80

James Michael DuPont <mdupont>
Thu 23 Jan 2003 06:45:22 AM UTC, comment #3:

Thanks,
i had to break on CCErrorOnLine
Here is the backtrace :

(gdb) bt
#0 CCErrorOnLine (filename=0x811b500 "cast3.cs", linenum=27,
format=0x80db680 "invalid operands to binary `+'") at cc_errors.c:95
#1 0x08053530 in ILNode_SemAnalysis_94__ ()
#2 0x0805a922 in ILNode_SemAnalysis ()
#3 0x0805bd30 in CSSemExpectValue ()
#4 0x08053e8d in ILNode_SemAnalysis_109__ ()
#5 0x0805aa99 in ILNode_SemAnalysis ()
#6 0x0804e5d8 in StmtSem ()
#7 0x08055ef9 in ILNode_SemAnalysis_152__ ()
#8 0x0805aecc in ILNode_SemAnalysis ()
#9 0x0804e5d8 in StmtSem ()
#10 0x08055ef9 in ILNode_SemAnalysis_152__ ()
#11 0x0805aecc in ILNode_SemAnalysis ()
#12 0x0804e5d8 in StmtSem ()
#13 0x0805756e in ILNode_SemAnalysis_172__ ()
#14 0x0805b0c0 in ILNode_SemAnalysis ()
#15 0x08058fd0 in ILNode_SemAnalysis_192__ ()
#16 0x0805b2b4 in ILNode_SemAnalysis ()
#17 0x0804e5d8 in StmtSem ()
#18 0x08055ef9 in ILNode_SemAnalysis_152__ ()
#19 0x0805aecc in ILNode_SemAnalysis ()
#20 0x080585bf in ILNode_SemAnalysis_187__ ()
#21 0x0805b237 in ILNode_SemAnalysis ()
#22 0x08058325 in ILNode_SemAnalysis_186__ ()
#23 0x0805b21e in ILNode_SemAnalysis ()
#24 0x0804e5d8 in StmtSem ()
#25 0x08055ef9 in ILNode_SemAnalysis_152__ ()
#26 0x0805aecc in ILNode_SemAnalysis ()
#27 0x080493f9 in CCPluginSemAnalysis () at cs_main.c:80
#28 0x0806c169 in CCMain (argc=17, argv=0xbffffaf4) at cc_main.c:163
#29 0x08049418 in main (argc=17, argv=0xbffffaf4) at cs_main.c:90

James Michael DuPont <mdupont>
Mon 20 Jan 2003 11:47:57 PM UTC, comment #2:

Just go in and fix it - we'll close once the patch comes
in. Breakpointing the compiler is weird. Grab the
following script and modify it to include your own
pathnames for the location of pnet and pnetlib:

http://www.southern-storm.com.au/download/compile.sh

Then, use "./compile.sh -fgdb blah.cs" and you'll be
dropped down into the debugger. Breakpoint CCError to
catch all errors.

Rhys Weatherley <rweather>
Project Administrator
Mon 20 Jan 2003 11:25:20 PM UTC, comment #1:

I have retested this. And get the same error. Can you please assign the bug to me so i can fix it?
How can I put a breakpoint on all errors in the cscc?

James Michael DuPont <mdupont>
Thu 02 Jan 2003 10:11:22 AM UTC, original submission:

In the attached test case, cscc complains

cast3.cs:27: invalid operands to binary `+'
cast3.cs:27: incompatible types in assignment: no conversion from `int' to `Integer'

I don't quite understand the second error, but the first error indicates that cscc does not think that 1 can be implicitly converted to uint.

(csc accepted the program without complaint.)

Marcus Urban <mathpup>

 

Attached Files
file #221:  cast3.cs added by mathpup (327B - text/x-csharp - Test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 26 Feb 2003 06:35:21 AM UTCrweatherStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1