assemblyscript-regex icon indicating copy to clipboard operation
assemblyscript-regex copied to clipboard

Fix AS210 error where expressions are never null

Open jonathannorris opened this issue 2 years ago • 0 comments

After updating to the latest version of Assemblyscript 0.20.1, we ran into a couple of small type errors:

INFO AS210: Expression is never 'null'.

       return matchStr != null ? new Match([matchStr!], 0, str) : null;
                                            ~~~~~~~~
 in ~lib/assemblyscript-regex/assembly/regexp.ts(162,44)

INFO AS210: Expression is never 'null'.

           [matchStr!].concat(lastCapturesForGroup(groupMarkers)),
            ~~~~~~~~
 in ~lib/assemblyscript-regex/assembly/regexp.ts(186,12)

INFO AS210: Expression is never 'null'.

       return matchStr != null ? new Match([matchStr!], 0, str) : null;
                                            ~~~~~~~~
 in ~lib/assemblyscript-regex/assembly/regexp.ts(162,44)

INFO AS210: Expression is never 'null'.

           [matchStr!].concat(lastCapturesForGroup(groupMarkers)),
            ~~~~~~~~
 in ~lib/assemblyscript-regex/assembly/regexp.ts(186,12)

Ended up being very minor fixes, let me know if you need any further details.

jonathannorris avatar Mar 25 '22 19:03 jonathannorris