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

table: interfaces: unique gen_types

This commit is contained in:
Alexander Medvednikov 2020-04-30 16:48:46 +02:00
parent 473617f061
commit 20013e4b4b
2 changed files with 4 additions and 1 deletions

View File

@ -490,7 +490,9 @@ pub fn (t &Table) check(got, expected Type) bool {
mut info := exp_type_sym.info as Interface
// println('gen_types before')
// println(info.gen_types)
info.gen_types << got_type_sym.name
if got_type_sym.name !in info.gen_types {
info.gen_types << got_type_sym.name
}
// println('adding gen_type $got_type_sym.name')
// println(info.gen_types)
return true

View File

@ -46,6 +46,7 @@ fn test_perform_speak() {
perform_speak(dog)
cat := Cat{}
perform_speak(cat)
perform_speak(Cat{})
perform_speakers([dog, cat])
/*
f := Foo {