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

Segmentation fault in printing nil #37

Closed
Ivo-Balbaert opened this issue Nov 13, 2021 · 2 comments
Closed

Segmentation fault in printing nil #37

Ivo-Balbaert opened this issue Nov 13, 2021 · 2 comments

Comments

@Ivo-Balbaert
Copy link
Contributor

The following code snippet segfaults at execution. Instead, it should generate an error message. It should be illegal to assign nil to dessert, and print <- nil should be a "function not found" error.

import stdio::*

imm hello = "Hello"

fn main():
  mut dessert = jello(hello)
  print <- dessert // <-- Segmentation fault

fn jello(mut saying [5; u8]):
  saying = "jello"
  saying
@jondgoodwin
Copy link
Owner

Fixed. Feel free to close if you agree.

@Ivo-Balbaert
Copy link
Contributor Author

Changing the signature of the jello function to
fn jello(mut saying [5; u8]) [5; u8]:
now prints out "jello"
All test-files compile and execute.

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

2 participants