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

Error message of missing return statement in a function #1001

Open
JunmingZhao42 opened this issue Jun 14, 2024 · 1 comment
Open

Error message of missing return statement in a function #1001

JunmingZhao42 opened this issue Jun 14, 2024 · 1 comment
Labels

Comments

@JunmingZhao42
Copy link

Currently I noticed that if we have a pancake function that doesn't have a return statement, for example in the below foo():

fun main() {
    var my_base = @base;
    foo(my_base);
    return 0;
}

fun foo(1 ptr) {
    var x = 42;    
    stw ptr, x;
}

This will trigger run time error Segmentation fault (core dumped).
It might be more convenient if it can be captured during compile time if a return statement is expected for every function.

@IlmariReissumies
Copy link
Member

Thanks for the issue Junming! We're aware of this, and plan to add a static check for this in the short to medium term :)

@mktnk3 mktnk3 added the Pancake label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants