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
False error 7022, circular reference when there is actually noneΒ #43708
typeUserRecord={name: string}asyncfunctionlistUsers(token: string|undefined){return{users: [{uid: 1,name: 'Gary'}],pageToken: 'b'}}exportasyncfunctionlistAuthUsers(){letnextPageToken=undefinedconstusers: {[uid: string]: UserRecord}={}do{constusersList=awaitlistUsers(nextPageToken)// <<<< ERROR 7022 hereusersList.users.forEach((user)=>{users[user.uid]=user})nextPageToken=usersList.pageToken// <<< ERROR DISAPPEARS IF THIS LINE IS COMMENTED OUT}while(nextPageToken)}
π Actual behavior
Code above gives error 7022. If you comment out the line nextPageToken = usersList.pageToken then it's OK.
User webstrand on the discord says "even weirder - just the presence of an unused generic causes this issue" with this playground link
and user T6 on discord commented "The reason it's giving that error is CFA
Because the type of nextPageToken depends on usersList, which depends on nextPageToken
Though interestingly it shouldn't really depend on nextPageToken."
Activity
tjjfvi commentedon Apr 16, 2021
Minimal repro
MartinJohns commentedon Apr 16, 2021
Duplicate of #43047.
typescript-bot commentedon Apr 19, 2021
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.