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

Empty contracts and structs require dummy fields in Move #12

Open
egroge opened this issue Jul 31, 2020 · 0 comments
Open

Empty contracts and structs require dummy fields in Move #12

egroge opened this issue Jul 31, 2020 · 0 comments
Labels
deferred Not a current priority enhancement New feature or request move ir Code generation for Libra

Comments

@egroge
Copy link
Collaborator

egroge commented Jul 31, 2020

If one were to write a contract or struct without any fields, like so:

contract MyContract {}

MyContract :: (any) {
  public init() {}

  public func one() -> Int {
    return 1
  }
}

then this will compile and work due to 011118f. However, the way that this works is just to insert a dummy variable into the underlying move struct if the contract is empty. This is not ideal. Ideally, we would not have a move struct for the contract at all if it is empty.

@egroge egroge added enhancement New feature or request move ir Code generation for Libra labels Jul 31, 2020
@mrRachar mrRachar changed the title Empty contracts require dummy variables in move Empty contracts require dummy fields in Move Jul 31, 2020
@mrRachar mrRachar added the deferred Not a current priority label Jul 31, 2020
@egroge egroge changed the title Empty contracts require dummy fields in Move Empty contracts and structs require dummy fields in Move Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deferred Not a current priority enhancement New feature or request move ir Code generation for Libra
Projects
None yet
Development

No branches or pull requests

2 participants