[Mono-list] Concatenation Bug
Dietmar Maurer
dietmar@ximian.com
05 Apr 2002 09:22:10 +0200
Hi Daniel,
The bug was in mono and is now fixed in CVS.
- Dietmar
On Fri, 2002-04-05 at 01:47, Daniel Carrera wrote:
> Hello,
>
> I still can't fix the problem. There is a bug somewhere and I don't think
> that it's been fixed. I have dowloaded the latest CVS for mono and it
> dind't help. I built mcs myself and it didn't help.
>
> Could someone look at my files. I'm including both the .cs and the .exe
> files. I'd appreciate it if someone could do any of:
>
> a.- Try running my .exe file and see if you get the error.
> b.- Try compiling my .cs file and see if you get the error when you run
> it.
> c.- Do a. and b. under Windows and see if it makes any difference.
>
> I don't have Windows myself, so I can't try this with the Microsoft SDK.
>
>
> For reference, the error I get is:
>
> $ mono ConcatTest.exe
>
> (process:20458): ** WARNING **: unhandled exception
> System.OverflowException: "Number overflow"
> in System.String:.ctor ()
> in System.String:Concat ()
> in .TestMoney:Main ()
>
>
>
> I'd greatly appreciate some help.
>
> Daniel.
> ----
>
> class Money {
> private double Amount;
> private string Currency;
>
> public Money(double amount,string currency) {
> //public Money(string currency) {
> Amount = amount;
> Currency = currency;
> }
> public string getCurrency() {
> return Currency;
> }
> }
>
> class TestMoney {
>
> public static void Main() {
> Money m = new Money(200,"CAD");
> //Money m = new Money("CAD");
> System.Console.WriteLine("Currency: " + m.getCurrency());
> }
> }