Skip to content
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

Memory, Table as a generic Type #89

Closed
3 tasks done
ballercat opened this issue Feb 24, 2018 · 0 comments
Closed
3 tasks done

Memory, Table as a generic Type #89

ballercat opened this issue Feb 24, 2018 · 0 comments

Comments

@ballercat
Copy link
Owner

ballercat commented Feb 24, 2018

Goal

Support custom memory declarations and imports.

Overview

Currently, it's only possible to import a default Memory type which has a { initial: 1 } value which cannot be overwritten with in any way. See #86

The updated syntax should convert Memory type to a generic.

New syntax:

// imports should look like so
import { memory: Memory<{ initial: 10, max: 20 }> } from 'env';

// declarations note the dropped initializer syntax
const memory: Memory<{ initial: 10, max: 100 }>;

// default Memory type should remain at { initial: 10 }, but the <> should be kept for consistency
const memory: Memory<>;

Acceptance Criteria

  • Tests
  • Tests pass
  • Updated examples and demos
This was referenced Mar 3, 2018
@ballercat ballercat changed the title Memory as a generic Type Memory, Table as a generic Type Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant