From fc67046bacc906b2724f23e0808cef2842e78c54 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 27 May 2020 03:38:21 +0200 Subject: [PATCH] checker: fix pub fn check --- vlib/v/checker/checker.v | 2 +- vlib/vweb/vweb.v | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index dd52fd3604..ba3f23e7a3 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -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) } } diff --git a/vlib/vweb/vweb.v b/vlib/vweb/vweb.v index 4ab0b6bc3f..60728492e5 100644 --- a/vlib/vweb/vweb.v +++ b/vlib/vweb/vweb.v @@ -43,7 +43,7 @@ pub: conn net.Socket form map[string]string // TODO Response -mut: +pub mut: headers string // response headers done bool }