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

Traits are largely unimplemented #22

Open
egroge opened this issue Sep 9, 2020 · 0 comments
Open

Traits are largely unimplemented #22

egroge opened this issue Sep 9, 2020 · 0 comments
Labels
enhancement New feature or request language Issues with the flint-2 Flint language implementation or features semantic check Problems with the semantic analysis stage

Comments

@egroge
Copy link
Collaborator

egroge commented Sep 9, 2020

Parsing of traits has been implemented.

Semantic analysis of traits does not seem to be implemented. The following should not be allowed to compile, because the struct does not satisfy the trait:

trait Numeric {
  func asInt() -> Int
}

struct NumWrapper: Numeric {
  var num: Int = 0
}

contract A {
  var numWrapper: NumWrapper = NumWrapper()
}

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

There is also no separate implementation for struct traits and contract states, as detailed in the flint guide

@egroge egroge added enhancement New feature or request language Issues with the flint-2 Flint language implementation or features semantic check Problems with the semantic analysis stage labels Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request language Issues with the flint-2 Flint language implementation or features semantic check Problems with the semantic analysis stage
Projects
None yet
Development

No branches or pull requests

1 participant