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
{{ message }}
Repository navigation
This condition will always return 'false' since the types 'true' and 'false' have no overlap #29155
This is an asynchronous method that controls its pause externally, so it needs to be removed at the right time. However, an error warning was given to indicate that this method is not feasible.
publicasyncshow(){this.showing=true;while(this.showing){for(constframeKeyinDogDto.EffectSaveInfo){// [ts] This condition will always return 'false' since the types 'true' and 'false' have no overlap.if(this.showing===false){this.container.removeAllChildren();break;}constframeInfo=DogDto.EffectSaveInfo[frameKey];constframeIndex=Number(frameKey);constframeBitmap=awaitBitmapUtils.getBitmap(DogDto.EffetcSaveImageList[frameIndex]);frameBitmap.x=-1*frameInfo.origin.x;frameBitmap.y=-1*frameInfo.origin.y;container.removeAllChildren();container.addChild(frameBitmap);awaitLarkDate.delay(frameInfo.delay);}}}publichide(){this.showing=false;}
This is basically the same as calling a function, method or callback that could modify a narrowed variable. There should be plenty of duplicate issues, IIRC there was at least one regarding await.
The proposed solution was using a method to retrieve the value instead of accessing the property directly.
Looks like control flow needs to be more pessimistic around await.
Why isn't this the correct answer? I understand the workaround, but it doesn't seem like it should be necessary. Not only does narrowing across await cause valid code to be rejected, it doesn't detect potential bugs due to narrowed values changing.
Activity
weswigham commentedon Dec 26, 2018
Looks like control flow needs to be more pessimistic around
await.txiaocao commentedon Dec 26, 2018
Temporarily changed to recursive writing :)
ajafff commentedon Dec 26, 2018
This is basically the same as calling a function, method or callback that could modify a narrowed variable. There should be plenty of duplicate issues, IIRC there was at least one regarding
await.The proposed solution was using a method to retrieve the value instead of accessing the property directly.
txiaocao commentedon Dec 26, 2018
yes, it work ...
trevorr commentedon Jun 8, 2022
Why isn't this the correct answer? I understand the workaround, but it doesn't seem like it should be necessary. Not only does narrowing across
awaitcause valid code to be rejected, it doesn't detect potential bugs due to narrowed values changing.