mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Don't print repl output if there were errors
This commit is contained in:
parent
062d532fa4
commit
a574dff481
1 changed files with 4 additions and 1 deletions
|
@ -425,7 +425,10 @@ fn format_output(
|
||||||
if let Some(ReplOutput { expr, expr_type }) = opt_output {
|
if let Some(ReplOutput { expr, expr_type }) = opt_output {
|
||||||
// If expr was empty, it was a type annotation or ability declaration;
|
// If expr was empty, it was a type annotation or ability declaration;
|
||||||
// don't print anything!
|
// don't print anything!
|
||||||
if !expr.is_empty() {
|
//
|
||||||
|
// Also, for now we also don't print anything if there was a compile-time error.
|
||||||
|
// In the future, it would be great to run anyway and print useful output here!
|
||||||
|
if !expr.is_empty() && problems.errors.is_empty() {
|
||||||
const EXPR_TYPE_SEPARATOR: &str = " : "; // e.g. in "5 : Num *"
|
const EXPR_TYPE_SEPARATOR: &str = " : "; // e.g. in "5 : Num *"
|
||||||
|
|
||||||
// Print the expr and its type
|
// Print the expr and its type
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue