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_ { if exp_type_sym.kind == .interface_ {
info := exp_type_sym.info as Interface info := exp_type_sym.info as Interface
println('gen_types before') // println('gen_types before')
println(info.gen_types) // println(info.gen_types)
info.gen_types << got_type_sym.name info.gen_types << got_type_sym.name
println('adding gen_type $got_type_sym.name') // println('adding gen_type $got_type_sym.name')
println(info.gen_types) // println(info.gen_types)
return true return true
} }
// allow enum value to be used as int // allow enum value to be used as int

View File

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