Skip to content

Clearer message about resources that can not be saved because having non-storable fields #1966

Open

Description

Problem

When you try to save to an account a resource that has a non-storable field, the message you get is mismatched types error: expected 'Storable', got '<Type>'. This leads to confusion about why the resource cannot be stored.

Steps to Reproduce

Create a resource that has a non-storable field (a reference for instance) and try to save it to an account.

https://github.com/onflow/voting-tutorial/blob/5c7af6e9b499b6b3b4e8216b9df575734e7dcc92/contracts/Voting.cdc#L68
https://github.com/onflow/voting-tutorial/blob/5c7af6e9b499b6b3b4e8216b9df575734e7dcc92/transactions/tx_04_CreateNewBallot.cdc#L21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions