[Mono-bugs] [Bug 338253] New: MCS compiler error with non-standard formatting and wrong error location
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Wed Oct 31 15:37:00 EDT 2007
https://bugzilla.novell.com/show_bug.cgi?id=338253
Summary: MCS compiler error with non-standard formatting and
wrong error location
Product: Mono: Compilers
Version: 1.2
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at ximian.com
ReportedBy: joe at unity3d.com
QAContact: mono-bugs at ximian.com
Found By: ---
error CS0121: The call is ambiguous between the following methods or
properties: `V3.operator true(V3, V3)' and `V2.operator true(V2, V2)'
/Users/joe/compiler_error/Test3.cs(30,26): (Location of the symbol related to
previous error)
Compilation failed: 1 error(s), 0 warnings
Instead it should output:
/Users/joe/compiler_error/Test3.cs(43,26): error CS0121: The call is ambiguous
between the following methods or properties: `V3.operator true(V3, V3)' and
`V2.operator true(V2, V2)'
Compilation failed: 1 error(s), 0 warnings
So basically mcs gives the wrong line number and reports it in a way that makes
it extremely hard to parse for a development tool.
mcs Test.cs
----- Test.cs
public struct V3
{
public float x, y, z;
public V3 (float ix, float iy, float iz) {x = ix; y = iy;z = iz; }
static public V3 operator - (V3 lhs, V3 rhs)
{
return new V3(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z);
}
}
public struct V2
{
public float x, y;
public V2 (float ix, float iy) {x = ix; y = iy; }
public static implicit operator V2(V3 v) {
return new V2(v.x, v.y);
}
public static implicit operator V3(V2 v) {
return new V3(v.x, v.y, 0);
}
static public V2 operator - (V2 lhs, V2 rhs)
{
return new V2(lhs.x - rhs.x, lhs.y - rhs.y);
}
}
internal class Test
{
static void Main ()
{
V2 a = new V2();
V3 b = new V3();
V2 s = a - b;
}
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list