Re: [Vala] [Genie] simple string example no longer compiles



 I know that you can just do

 var s = ""

 I am asking about

 var s = new string

 To me, it *does* make sense, but anyway, I am not asking about it's
 merits. I would like to know why it compiled before, not now.
 It looks like quite legal syntax to me, and the compiler was happy
 with it, and if it is now not legal, why not?

 Regards,
 Barry Kauler


On 10/26/09, Julian Andres Klode <jak jak-linux org> wrote:
Am Montag, den 26.10.2009, 05:30 +0800 schrieb Barry Kauler:
Hi guys,
There is a very simple Genie program that compiled ok early in 2009:

init
    var s = new string
    s += "My name is Barry"
    print s

I have got Vala out of git yesterday, and the above program will not
compile, with this error:

arrays.gs:2.10-2.19: error: `string' does not have a default constructor
        var s = new string

Could someone explain this to me? I don't understand why this code was
ok before but no longer.
Why not simply var s = "" instead of new string? In my opinion, having
a constructor for string which takes a string does not make any sense.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]