table: fix error in field/method lookup from previous commit

pull/3990/head
Joe Conigliaro 2020-03-11 20:53:14 +11:00
parent 7513dab185
commit 7309be55a0
1 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ pub fn (t &Table) type_find_method(s &TypeSymbol, name string) ?Fn {
if method := ts.find_method(name) {
return method
}
if s.parent_idx == 0 {
if ts.parent_idx == 0 {
break
}
ts = &t.types[ts.parent_idx]
@ -164,7 +164,7 @@ pub fn (t &Table) struct_find_field(s &TypeSymbol, name string) ?Field {
if field := ts.find_field(name) {
return field
}
if s.parent_idx == 0 {
if ts.parent_idx == 0 {
break
}
ts = &t.types[ts.parent_idx]