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

vet: fix vet documentation error for methods with generics (#18464)

This commit is contained in:
Artem Yurchenko 2023-06-16 08:44:25 +02:00 committed by GitHub
parent 34163ae44b
commit 75f325b950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -0,0 +1,2 @@
// my_generic_method this is a documentation of my method
pub fn my_generic_method[T](value T) {}

View File

@ -153,7 +153,8 @@ fn (mut vt Vet) vet_fn_documentation(lines []string, line string, lnumber int) {
}
}
if tokens.len > 0 {
return tokens[0].all_before('(')
function_name_with_generic_parameters := tokens[0].all_before('(')
return function_name_with_generic_parameters.all_before('[')
}
return ''
}