mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v: support compiler notices. Use them for [deprecated_after: '2021-05-01'] tags
Compiler notices are like warnings, with these differences: a) notices use a different color. b) notices use a different label. c) notices do not prevent compilation with -prod. (warnings are converted to errors with -prod)
This commit is contained in:
@@ -61,9 +61,11 @@ fn color(kind string, msg string) string {
|
||||
}
|
||||
if kind.contains('error') {
|
||||
return term.red(msg)
|
||||
} else {
|
||||
return term.magenta(msg)
|
||||
}
|
||||
if kind.contains('notice') {
|
||||
return term.yellow(msg)
|
||||
}
|
||||
return term.magenta(msg)
|
||||
}
|
||||
|
||||
// formatted_error - `kind` may be 'error' or 'warn'
|
||||
|
||||
Reference in New Issue
Block a user