table: minor interface clean up

pull/4601/head
Alexander Medvednikov 2020-04-26 05:32:41 +02:00
parent a77640165e
commit 60a0ba5eaa
2 changed files with 8 additions and 8 deletions

View File

@ -487,11 +487,11 @@ pub fn (t &Table) check(got, expected Type) bool {
//
if exp_type_sym.kind == .interface_ {
info := exp_type_sym.info as Interface
println('gen_types before')
println(info.gen_types)
// println('gen_types before')
// println(info.gen_types)
info.gen_types << got_type_sym.name
println('adding gen_type $got_type_sym.name')
println(info.gen_types)
// println('adding gen_type $got_type_sym.name')
// println(info.gen_types)
return true
}
// allow enum value to be used as int

View File

@ -37,8 +37,8 @@ fn perform_speak(s Speaker) {
s.speak()
assert true
name := s.name()
assert name == 'Dog' || name == 'Cat'
println(s.name())
assert name == 'Dog' || name == 'Cat'
println(s.name())
}
fn test_perform_speak() {
@ -46,7 +46,7 @@ fn test_perform_speak() {
perform_speak(dog)
cat := Cat{}
perform_speak(cat)
//perform_speakers([dog, cat])
perform_speakers([dog, cat])
/*
f := Foo {
speaker: dog
@ -54,7 +54,7 @@ fn test_perform_speak() {
*/
}
//fn perform_speakers(speakers []Speaker) {}
fn perform_speakers(speakers []Speaker) {}
/*
interface Speak2er {