Strange behavior of VS.NET 2003

  • Thread starter Leszek Taratuta
  • Start date

L

Leszek Taratuta

Hello,

I posted this problem a few days ago. I am not sure if I was not enough
specific but nobody answered, so I am posting it again:

I have the following code snippet that overloads the "-" operator (just copy
and paste to your CS file):

public class Vector
{
public float X = 0.0F;
public float Y = 0.0F;

public Vector( float x, float y )
{
this.X = x;
this.Y = y;
}

// unary
public static Vector operator -( Vector v )
{
return new Vector( -v.X, -v.Y );
}

// binary
public static Vector operator -( Vector v1, Vector v2 )
{
return new Vector( v1.X-v2.X, v1.Y-v2.Y );
}
}

It compiles fine, but when I switch to "Class View" in "Solution Explorer"
both operators have a red exclamation sign and a message: "Unable to create
description".

Is it something wrong or just a weirdness of VS.NET 2003?

Thanks,
Leszek
 
Ad

Advertisements

N

Nicholas Paldino [.NET/C# MVP]

Leszek,

It appears to be a bug, one that was fixed in VS.NET 2005 beta 1 (at
least from what I can tell, as I don't get that result).

Hope this helps.
 
Ad

Advertisements

L

Leszek Taratuta

Thanks a lot.
BTW I get this error message each time I overload any operator more than
once. It does not have any impact on the run-time code, though. It is
visible only in Class View.

Leszek

Nicholas Paldino said:
Leszek,

It appears to be a bug, one that was fixed in VS.NET 2005 beta 1 (at
least from what I can tell, as I don't get that result).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Leszek Taratuta said:
Hello,

I posted this problem a few days ago. I am not sure if I was not enough
specific but nobody answered, so I am posting it again:

I have the following code snippet that overloads the "-" operator (just
copy
and paste to your CS file):

public class Vector
{
public float X = 0.0F;
public float Y = 0.0F;

public Vector( float x, float y )
{
this.X = x;
this.Y = y;
}

// unary
public static Vector operator -( Vector v )
{
return new Vector( -v.X, -v.Y );
}

// binary
public static Vector operator -( Vector v1, Vector v2 )
{
return new Vector( v1.X-v2.X, v1.Y-v2.Y );
}
}

It compiles fine, but when I switch to "Class View" in "Solution Explorer"
both operators have a red exclamation sign and a message: "Unable to
create
description".

Is it something wrong or just a weirdness of VS.NET 2003?

Thanks,
Leszek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top