table: minor interface clean up
parent
a77640165e
commit
60a0ba5eaa
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue