diff --git a/vlib/compiler/main.v b/vlib/compiler/main.v index 0754b2c021..f56c445b24 100644 --- a/vlib/compiler/main.v +++ b/vlib/compiler/main.v @@ -9,7 +9,7 @@ import ( strings ) -const ( +pub const ( Version = '0.1.21' ) diff --git a/vlib/compiler/parser.v b/vlib/compiler/parser.v index e1a8d5d729..29f9355252 100644 --- a/vlib/compiler/parser.v +++ b/vlib/compiler/parser.v @@ -1850,7 +1850,7 @@ fn (p mut Parser) name_expr() string { return p.get_const_type(name, ptr) } - // Function (not method btw, methods are handled in dot()) + // Function (not method, methods are handled in `.dot()`) mut f := p.table.find_fn_is_script(name, p.v_script) or { return p.get_undefined_fn_type(name, orig_name) } @@ -1964,6 +1964,9 @@ fn (p mut Parser) get_const_type(name string, is_ptr bool) string { // c.ptr = true p.gen('& /*const*/ ') } + if !c.is_public && c.mod != p.mod { + p.warn('constant `$c.name` is private') + } mut typ := p.var_expr(c) if is_ptr { typ += '*' diff --git a/vlib/compiler/vhelp.v b/vlib/compiler/vhelp.v index 6eab8dc506..27c9cd7f14 100644 --- a/vlib/compiler/vhelp.v +++ b/vlib/compiler/vhelp.v @@ -1,6 +1,6 @@ module compiler -const ( +pub const ( help_text = 'Usage: v [options/commands] [file.v | directory] When V is run without any arguments, it is run in REPL mode. diff --git a/vlib/os/os.v b/vlib/os/os.v index f866fe0487..8835b54d0b 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -26,7 +26,7 @@ struct C.dirent { fn C.readdir(voidptr) C.dirent -const ( +pub const ( args = []string MAX_PATH = 4096 ) diff --git a/vlib/os/os_nix.v b/vlib/os/os_nix.v index 4abce85b37..4bae3d3361 100644 --- a/vlib/os/os_nix.v +++ b/vlib/os/os_nix.v @@ -3,7 +3,7 @@ module os #include #include -const ( +pub const ( path_separator = '/' ) diff --git a/vlib/os/os_windows.v b/vlib/os/os_windows.v index 36348c5762..032a0d97e5 100644 --- a/vlib/os/os_windows.v +++ b/vlib/os/os_windows.v @@ -3,7 +3,7 @@ module os #flag -lws2_32 #include -const ( +pub const ( path_separator = '\\' )