Error: Debug Failure at typeToString
错误详情如下:
ERROR in : Error: Debug Failure. at typeToString (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:28777:22) at reportRelationError (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:34714:34) at isRelatedTo (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:34860:21) at checkTypeRelatedTo (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:34697:26) at checkApplicableSignature (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:40608:26) at resolveCall (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41011:17) at resolveCallExpression (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41163:20) at resolveSignature (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41398:28) at getResolvedSignature (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41430:26) at checkCallExpression (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41479:29) at checkExpressionWorker (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:42950:28) at checkExpression (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:42898:42) at checkExpressionStatement (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:44962:13) at checkSourceElement (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:46746:28) at Object.forEach (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:1506:30) at checkBlock (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:44563:16)
我代码里出现这个错误的原因是 在定义Map的时候,值为数组类型,但未给数组赋值泛型
,如下:
public renderStateMap = new Map<string, []>();
解决方案:
只需要给数组添加类型即可:
public renderStateMap = new Map<string, any[]>();
相关推荐
QiaoranC 2020-09-25
xiaofanguan 2020-06-07
changcongying 2020-10-30
zouph000 2020-10-25
Jruing 2020-10-23
changcongying 2020-11-02
苗疆三刀的随手记 2020-10-29
ctg 2020-10-14
PMJ0 2020-10-13
ChaITSimpleLove 2020-10-06
小飞侠V 2020-09-25
changcongying 2020-09-17
taizuduojie 2020-09-15
淼寒儿 2020-09-13
lyjava 2020-09-11
彤庆的技术 2020-09-02
锅哥 2020-08-27
ruanhongbiao 2020-08-16
zouph000 2020-08-03