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

should we avoid executing programs with errors? #220

Open
vemoo opened this issue Oct 6, 2022 · 2 comments
Open

should we avoid executing programs with errors? #220

vemoo opened this issue Oct 6, 2022 · 2 comments

Comments

@vemoo
Copy link
Contributor

vemoo commented Oct 6, 2022

While implementing #217 I found that dada run executes even if there are errors, which causes this program to enter an infinite loop:

async fn main() {
    i = 0
    while i < 1 {
        print(i).await
        $ # invalid syntax
        i += 1
    } 
}

I think we should avoid running if we encounter any diagnostic with Severity::Error.

That can also happen for dada test and maybe on web playground?

@nikomatsakis
Copy link
Member

Actually, it's my intent that we always run programs, even with errors. Part of the goal of the compiler is to be able to always generate something a user can run.

@nikomatsakis
Copy link
Member

However, if we encounter invalid syntax, or other super painful errors, we could have the program abort when it reaches that point in execution.

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