I've hidden the warning when -js-default-initializers=false is used.
However, it will remain visible in vscode-as3mxml (or any editor using the
as3mxml language server) for the time being. I'll update it in
vscode-as3mxml as soon as possible after the next Royale release.

--
Josh Tynjala
Bowler Hat LLC
https://bowlerhat.dev/


On Mon, Apr 27, 2026 at 9:33 AM Harbs <[email protected]> wrote:

> > Are you using the -js-default-initializers=false compiler option?
>
> Yes. I am.
>
> Making the warning dependent on that option makes sense.
>
> > On Apr 27, 2026, at 7:30 PM, Josh Tynjala <[email protected]>
> wrote:
> >
> > Are you using the -js-default-initializers=false compiler option? Maybe
> > this warning should not be reported in that case.
> >
> > If you aren't using that compiler option, then variables of type Number
> > will always be initialized to a non-null value. By default, Number
> defaults
> > to NaN and can't be set to null. It gets coerced.
> >
> > --
> > Josh Tynjala
> > Bowler Hat LLC
> > https://bowlerhat.dev/
> >
> >
> > On Mon, Apr 27, 2026 at 1:52 AM Harbs <[email protected]> wrote:
> >
> >> We just noticed that if you use the "Nullish coalescing operator" (??)
> on
> >> anything which is not an object, it will cuase the compiler to show a
> >> warning of something like "Comparison between a value of type Number
> and an
> >> unrelated type Null.”.
> >>
> >> The warning makes some technical sense, but it seems to me like it’s not
> >> something we want in practice. It makes it less useful on uninitialized
> >> values.
> >>
> >> Thoughts?
> >>
> >> Harbs
>
>

Reply via email to