anura-engine / anura

Anura Engine
Other
384 stars 78 forks source link

"is not null" doesn't seem to be doing the same type inference "!= null" does. #350

Open DDR0 opened 1 year ago

DDR0 commented 1 year ago

https://discord.com/channels/225816341737766912/957180642037202986/1071643217637949441

So if you have a if (me_base_card is not null and new_base_card is not null, set(new_base_card.portrait, me_base_card.portrait) ) where me_base_card = me.base_card where new_base_card = new_creature.base_card

And base_card is a map|null type, shouldn't the if statement signal to the engine that it's me_base_card and new_base_card can only be map and not null within the if statement?

LaserCat — Yesterday at 20:01 if (me_base_card is not null and new_base_card is not null, set(new_base_card.portrait, me_base_card.portrait) ) where me_base_card = me.base_card where new_base_card = new_creature.base_card [20:01] for easier reading ^

Touhou Project 東方プロジェクト — Yesterday at 20:07 OK so "is not null" doesn't work but "!= null" does

DDR0 commented 1 year ago

Probable duplicate of #273 and #6.