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

Make primitive type bounds a typechecker error #272

Open
ReedOei opened this issue Jul 31, 2019 · 0 comments
Open

Make primitive type bounds a typechecker error #272

ReedOei opened this issue Jul 31, 2019 · 0 comments

Comments

@ReedOei
Copy link
Collaborator

ReedOei commented Jul 31, 2019

Currently, the following code:

contract X implements int {}

gives a parser error, because int is a primitive type, which cannot be implemented. It would be ideal to make this into a typechecking error instead so the compilation process can continue.

This can be done as follows:

  1. Create a new class extending GenericBound (e.g., PrimitiveBound).
  2. In an AST transform, log an error every time a PrimitiveBound is encountered, and turn it into a standard Top bound.
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

1 participant