WebAssembly / component-model

Repository for design and specification of the Component Model
Other
981 stars 82 forks source link

UnboundLocalError: cannot access local variable 'flat_vals' in lower_values #375

Closed safx closed 4 months ago

safx commented 4 months ago

The function lower_values raises UnboundLocalError in some case.

    :
  File "/Users/mac/src/tmp/component-model/design/mvp/canonical-abi/definitions.py", line 1126, in lower_values
    return flat_vals
           ^^^^^^^^^
UnboundLocalError: cannot access local variable 'flat_vals' where it is not associated with a value

As an example, I fixed this problem and added unit tests to the commit https://github.com/safx/component-model/commit/797fea690aece18bf1c9d0d406bb91a0cd0a007d in the forked repository.

lukewagner commented 4 months ago

Thanks for pointing this out! I fixed the typo and added a test here