You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionorNull(i: i32): Foo|null{if(i%2==0)returnnull;returnnewFoo();}functionexample(): Foo|null{letx: Foo|null=orNull(1);if(x==null){returnnull;}returnid(x);// x is not null, but compiler requires an explicit cast.}functionid(f: Foo): Foo{returnf;}
Not sure how big of a problem this is since it might be better to enforce being explicit, but I thought I'd share it. Also the same is true for if/else branches.
The text was updated successfully, but these errors were encountered:
Closing this issue as part of 2020 vacuum because this seems to be fixed meanwhile by extending null checks, at least when using ===, with everything further being tracked in the respective issues dealing with changing the semantics of triple equals.
Here is the working example: https://webassembly.studio/?f=zi21djvj57
Consider this example
Not sure how big of a problem this is since it might be better to enforce being explicit, but I thought I'd share it. Also the same is true for if/else branches.
The text was updated successfully, but these errors were encountered: