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

type in decl is ignored in favour of RHS #21

Open
sillydan1 opened this issue Jul 28, 2024 · 1 comment
Open

type in decl is ignored in favour of RHS #21

sillydan1 opened this issue Jul 28, 2024 · 1 comment
Labels
bug 🐛 Something isn't working as expected

Comments

@sillydan1
Copy link
Owner

sillydan1 commented Jul 28, 2024

example:

public clock x := 0;
public clock y := 0_ms;

will not evaluate to a clock variable. It will evaluate to an int:

evaluated:
    x :-> 0 i
    y :-> 0 c

The clock keyword is being ignored in favour of the right-hand-side expression...

You can even do this:

clock x := "test"

and it will work.

We should throw an exception if the RHS and type specification does not match (or cannot be implicitly converted).

essentially, all TYPEs are treated as auto at the moment

@sillydan1 sillydan1 added the bug 🐛 Something isn't working as expected label Jul 28, 2024
@sillydan1 sillydan1 changed the title type in decl is ignored in favor of RHS type in decl is ignored in favour of RHS Jul 28, 2024
@sillydan1
Copy link
Owner Author

On that note, the access modifier is also ignored - this is probably fine, as it can at least be overridden by a custom driver implementation.

sillydan1 added a commit that referenced this issue Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

1 participant