checker: fix pub fn check

pull/4971/head
Alexander Medvednikov 2020-05-27 03:38:21 +02:00
parent 7c9279c447
commit fc67046bac
2 changed files with 2 additions and 2 deletions

View File

@ -135,7 +135,7 @@ fn (mut c Checker) check_file_in_main(file ast.File) bool {
c.error('function `main` cannot return values', it.pos)
}
} else {
if it.is_pub {
if it.is_pub && !it.is_method {
c.warn('function `$it.name` $no_pub_in_main_warning', it.pos)
}
}

View File

@ -43,7 +43,7 @@ pub:
conn net.Socket
form map[string]string
// TODO Response
mut:
pub mut:
headers string // response headers
done bool
}