Skip to content

Commit 0c759b8

Browse files
committed
Add regression test
1 parent e852627 commit 0c759b8

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/cases/compiler/controlFlowSelfReferentialLoop.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,23 @@ function md5(string:string): void {
9999
b=II(b,c,d,a,x[k+9], S44,0xEB86D391);
100100
}
101101
}
102-
export default md5;
102+
export default md5;
103+
104+
// Repro from #26655
105+
106+
interface DataShape {
107+
message: { id: string }
108+
}
109+
110+
function getObject(id: string | number) {
111+
return {} as any
112+
}
113+
114+
;(() => {
115+
let id: string | number = 'a'
116+
while (1) {
117+
const data = getObject(id) as DataShape
118+
const message = data.message
119+
id = message.id
120+
}
121+
})()

0 commit comments

Comments
 (0)