bug: default value for negative float param

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

bug: default value for negative float param

Robin Palotai
Hi!

A colleague of mine discovered that when declaring a function, a Float
variable can't have negative default value (Int's are ok).
Compiler message: Main.hx:10: characters 35-41 : Parameter default
value should be constant

For the function:

public function aaa(x : Float = -1) {
     trace(x);
}

Cheers!
Robin

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: bug: default value for negative float param

Nicolas Cannasse
Robin Palotai a écrit :

> Hi!
>
> A colleague of mine discovered that when declaring a function, a Float
> variable can't have negative default value (Int's are ok).
> Compiler message: Main.hx:10: characters 35-41 : Parameter default
> value should be constant
>
> For the function:
>
> public function aaa(x : Float = -1) {
>      trace(x);
> }

I think that's already fixed in 2.01

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: bug: default value for negative float param

Robin Palotai
Strange, I use the haxe 2.01 linux binary, and it still gives me this message.
Robin

On Thu, Oct 30, 2008 at 9:25 PM, Nicolas Cannasse
<[hidden email]> wrote:

> Robin Palotai a écrit :
>>
>> Hi!
>>
>> A colleague of mine discovered that when declaring a function, a Float
>> variable can't have negative default value (Int's are ok).
>> Compiler message: Main.hx:10: characters 35-41 : Parameter default
>> value should be constant
>>
>> For the function:
>>
>> public function aaa(x : Float = -1) {
>>     trace(x);
>> }
>
> I think that's already fixed in 2.01
>
> Best,
> Nicolas
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: bug: default value for negative float param

Nicolas Cannasse
In reply to this post by Robin Palotai
Robin Palotai a écrit :

> Hi!
>
> A colleague of mine discovered that when declaring a function, a Float
> variable can't have negative default value (Int's are ok).
> Compiler message: Main.hx:10: characters 35-41 : Parameter default
> value should be constant
>
> For the function:
>
> public function aaa(x : Float = -1) {
>      trace(x);
> }

Fixed on CVS.

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org