1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: disallow more reserved types to be used as variable names (#17917)

This commit is contained in:
Swastik Baranwal 2023-04-09 17:12:21 +05:30 committed by GitHub
parent b772731b98
commit 6acf01a4a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ pub const (
array_builtin_methods_chk = token.new_keywords_matcher_from_array_trie(array_builtin_methods)
// TODO: remove `byte` from this list when it is no longer supported
reserved_type_names = ['byte', 'bool', 'char', 'i8', 'i16', 'int', 'i64', 'u8', 'u16',
'u32', 'u64', 'f32', 'f64', 'map', 'string', 'rune']
'u32', 'u64', 'f32', 'f64', 'map', 'string', 'rune', 'usize', 'isize', 'voidptr']
reserved_type_names_chk = token.new_keywords_matcher_from_array_trie(reserved_type_names)
vroot_is_deprecated_message = '@VROOT is deprecated, use @VMODROOT or @VEXEROOT instead'
)