add check for always true, and pretty warnings
This commit is contained in:
parent
c8660a6471
commit
0d66db35aa
2 changed files with 54 additions and 11 deletions
10
cli/main.go
10
cli/main.go
|
|
@ -138,11 +138,15 @@ func makeChunk(ctx *Context, fpath string, ignoreWarnings bool) (*core.Chunk, er
|
|||
}
|
||||
|
||||
// if there were non-critical warnings, report them
|
||||
if !ignoreWarnings && len(c.Warnings) != 0 {
|
||||
if len(c.Warnings) != 0 {
|
||||
for _, warning := range c.Warnings {
|
||||
log.Println(warning.Format())
|
||||
log.Println(warning.Format() + "\n")
|
||||
}
|
||||
if !ignoreWarnings {
|
||||
return nil, errors.New("compiler reported warning(s) (run anyways with --ignore-warnings)")
|
||||
} else {
|
||||
log.Println("compiler reported warning(s), but running anyways")
|
||||
}
|
||||
log.Fatal("compiler reported warning(s) (ignore warnings with the --ignore-warnings option)")
|
||||
}
|
||||
|
||||
return c.Chunk, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue