make "unreachable code" a warning in non-prod builds

pull/3807/head
Alexander Medvednikov 2020-02-21 18:55:18 +01:00
parent 1d90c1cbbf
commit e0c6766a79
2 changed files with 1 additions and 2 deletions

View File

@ -1424,7 +1424,7 @@ fn (p mut Parser) gen(s string) {
fn (p mut Parser) statement(add_semi bool) string {
p.expected_type = ''
if p.returns {
p.error('unreachable code')
p.warn_or_error('unreachable code')
}
// if !p.in_dispatch {
p.cgen.is_tmp = false

View File

@ -76,6 +76,5 @@ fn get_user() ?User {
fn get_user_ptr() &User {
return &User{
}
}