talonvoice / beta

Issue tracker for the private Talon Beta
10 stars 0 forks source link

"ERROR failed to type check script" doesn't provide any context #128

Closed lslunis closed 3 years ago

lslunis commented 3 years ago

I just got this error with no indication of the cause (my guess is that it's due to me trying to return a list from a capture). It'd be nice if it mentioned the name of the capture or action that was broken:

2020-09-29 14:59:03 ERROR failed to type check script
   42:            <stdlib>/threading.py:890|
   41:            <stdlib>/threading.py:926|
   40:            <stdlib>/threading.py:870|
   39:                    talon\cron.py:112|
   38: ------------------------------------# cron thread
   37:                    talon\cron.py:77 |
   36:          talon\scripting\rctx.py:200|
   35: ------------------------------------# 'cron' main:<lambda>()
   34:                     talon\vad.py:16 |
   33:             talon\engines\w2l.py:742|
   32:      talon\scripting\dispatch.py:98 |
   31:      talon\scripting\dispatch.py:133|
   30:      talon\scripting\dispatch.py:124|
   29:          talon\scripting\rctx.py:200|
   28: ------------------------------------# 'phrase' user.engines:_redispatch()
   27: talon\scripting\speech_system.py:42 |
   26:      talon\scripting\dispatch.py:98 |
   25:      talon\scripting\dispatch.py:133|
   24:      talon\scripting\dispatch.py:124|
   23:          talon\scripting\rctx.py:200|
   22: ------------------------------------# 'phrase' user.engines:engine_event()
   21: talon\scripting\speech_system.py:305|
   20:       talon\scripting\actions.py:56 |
   19:         talon\scripting\types.py:313|
   18:          talon\scripting\core.py:84 |
   17:       talon\scripting\actions.py:56 |
   16:         talon\scripting\types.py:313|
   15:          talon\scripting\core.py:106|
   14:       talon\scripting\actions.py:56 |
   13:         talon\scripting\types.py:313|
   12:          talon\scripting\core.py:121|
   11:       talon\scripting\actions.py:56 |
   10:         talon\scripting\types.py:313|
    9:          talon\scripting\core.py:142|
    8:  talon\scripting\talon_script.py:513|
    7: ------------------------------------# stack splice
    6:  talon\scripting\talon_script.py:511|
    5:  talon\scripting\talon_script.py:487|
    4:  talon\scripting\talon_script.py:219|
    3:  talon\scripting\talon_script.py:475|
    2:    talon\scripting\type_check.py:176|
    1:    talon\scripting\type_check.py:49 |
TypeError: unhashable type: 'list'
lunixbochs commented 3 years ago

Can you post your capture source here? Is it by any chance def fn() -> []:?

lslunis commented 3 years ago

As discussed in #beta, it was def fn() -> [(int, str)]:, so that explains it. It'd be nice if the fn name was surfaced in the error message, but this seems pretty minor.

lunixbochs commented 3 years ago

this should be fixed in the current beta