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[]>();
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值