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

Don't ignore non-fatal parser errors when analysis succeeds #535

Merged
merged 1 commit into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ pub fn compile(
}
};

if !errors.is_empty() {
// There was a non-fatal parser error (eg missing parens in a fn def `fn foo: ...`)
return Err(CompileError(errors));
}

// build abi
let json_abis = fe_abi::build(&db, module_id).expect("failed to generate abi");

Expand Down
2 changes: 2 additions & 0 deletions newsfragments/535.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Non-fatal parser errors (eg missing parentheses when defining a function that takes no arguments: `fn foo:`)
are no longer ignored if the semantic analysis stage succeeds.