Null<Int> bug?

30 views
Skip to first unread message

Mihail Ivanchev

unread,
Mar 5, 2012, 3:13:45 PM3/5/12
to haxe...@googlegroups.com
Hey List,

I have

class A
{
    var f:Null<Int>;

    public function new(?f:Null<Int>)
    {
         this.f = f;

         trace(f);
         trace(this.f);
    }
}

Traces:

null,
0

Is this expected?

Simon Krajewski

unread,
Mar 5, 2012, 3:18:32 PM3/5/12
to haxe...@googlegroups.com

Which platform?

Simon

Mihail Ivanchev

unread,
Mar 5, 2012, 3:20:39 PM3/5/12
to haxe...@googlegroups.com
Oh, sorry, forgot that, the platform is Flash.

Regards,
Mihail

Nicolas Cannasse

unread,
Mar 5, 2012, 3:25:38 PM3/5/12
to haxe...@googlegroups.com
Le 05/03/2012 21:20, Mihail Ivanchev a �crit :

> Oh, sorry, forgot that, the platform is Flash.

Can't reproduce with SVN.

Best,
Nicolas

Simon Krajewski

unread,
Mar 5, 2012, 3:26:04 PM3/5/12
to haxe...@googlegroups.com
Am 05.03.2012 21:20, schrieb Mihail Ivanchev:
> Oh, sorry, forgot that, the platform is Flash.

package ;

class Main
{

static function main()
{
new A();
}

}

class A
{
var f:Null<Int>;

public function new(?f:Null<Int>)
{
this.f = f;

trace(f);
trace(this.f);
}
}

I get null for both traces on flash 8 and flash 9. Which version of
Flash Player are you using?

Simon

Mihail Ivanchev

unread,
Mar 5, 2012, 3:31:23 PM3/5/12
to haxe...@googlegroups.com
Thanks, let me search for a bug on my side again. Might be I'm doing something stupid. I just compile with the default '-swf'.

Regards,
Mihail

Mihail Ivanchev

unread,
Mar 5, 2012, 3:42:59 PM3/5/12
to haxe...@googlegroups.com
OK, my bug, sorry and thanks!

</close>

Baluta Cristian

unread,
Mar 5, 2012, 3:51:31 PM3/5/12
to haxe...@googlegroups.com
What was?

Sent from my iPhone

Mihail Ivanchev

unread,
Mar 5, 2012, 4:24:14 PM3/5/12
to haxe...@googlegroups.com
I was setting the value to 0 in the property setter due to faulty logic :/
Reply all
Reply to author
Forward
0 new messages