Skip to content

Nested structures do not work. (array of array of classes) #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
janedegtiareva opened this issue Feb 12, 2019 · 5 comments
Closed

Nested structures do not work. (array of array of classes) #18

janedegtiareva opened this issue Feb 12, 2019 · 5 comments

Comments

@janedegtiareva
Copy link

fiddle that reproes https://studio.nearprotocol.com/?f=opapxvcfg

fails on assert(name == null); in the following code

      buffer: Uint8Array;
      decoder: JSONDecoder<__near_JSONHandler_Array_Array_GameCellData>;
      handledRoot: boolean = false;
      value: Array<Array<wrapped_GameCellData>> = new Array<Array<wrapped_GameCellData>>();
pushObject(name: string): bool {
        this.value.push(<Array<GameCellData>>__near_decode_Array_GameCellData(this.buffer, this.decoder.state));
        return false;
      }
      pushArray(name: string): bool {
        assert(name == null);
        if (!this.handledRoot) {
          this.handledRoot = true;
          return true;
        }
        this.value.push(<Array<GameCellData>>__near_decode_Array_GameCellData(this.buffer, this.decoder.state));
        return false;
      }```
@janedegtiareva
Copy link
Author

This is the smallest fiddle that I could get to repro the bug https://studio.nearprotocol.com/?f=rw4kghq7a

@vgrichina
Copy link

Updated for latest NEARLib https://studio.nearprotocol.com/?f=i98us2ahd

@vgrichina
Copy link

vgrichina commented Feb 16, 2019

This got somewhat blocked by AssemblyScript#473 (AssemblyScript#429 to be more specific).

I'll try to restructure tests to get around this though.

@vgrichina
Copy link

Actual bug was with null handling delaying error significantly:
AssemblyScript#507

@vgrichina
Copy link

Closing, tests are here #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants