ReSharper 8.2: TypeScript lambda function results in incorrect static analysis

I have a TypeScript function like this:

 
var earliest = null;
eventList.forEach(function (event) {
     if (earliest == null || event.start < earliest) { earliest = event.start; }
}, this);
this.setEarliest(earliest);


When it's in function form, this does not warn me that earliest will always be null. But rewrite it as a lambda function:

var earliest = null;
eventList.forEach((event) => {
     if (earliest == null || event.start < earliest) { earliest = event.start; }
}, this);
this.setEarliest(earliest);

Now I get a blue squiggle on the last line under "earliest" that warns me "expression will always be null".
1 comment
Comment actions Permalink

Hi, Anthony!

Thank you for reporting this issue, it is fixed for 9.0:
http://youtrack.jetbrains.com/issue/RSRP-411914

0

Please sign in to leave a comment.