mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ast, checker: fix checking generic struct type mismatch (#16701)
This commit is contained in:
@ -1799,7 +1799,12 @@ pub fn (mut t Table) generic_type_names(generic_type Type) []string {
|
||||
}
|
||||
Struct, Interface, SumType {
|
||||
if sym.info.is_generic {
|
||||
names << sym.info.generic_types.map(t.sym(it).name)
|
||||
if sym.generic_types.len > 0 {
|
||||
// Foo[U] (declaration: Foo[T])
|
||||
names << sym.generic_types.map(t.sym(it).name)
|
||||
} else {
|
||||
names << sym.info.generic_types.map(t.sym(it).name)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {}
|
||||
|
Reference in New Issue
Block a user