@@ -1193,14 +1193,14 @@ pub fn (mut c Checker) method_call(mut node ast.CallExpr) ast.Type {
11931193 method = m
11941194 has_method = true
11951195 } else {
1196- if left_sym .kind in [.struct_, .sum_type, .interface_] {
1196+ if final_left_sym .kind in [.struct_, .sum_type, .interface_] {
11971197 mut parent_type := ast.void_type
1198- if left_sym .info is ast.Struct {
1199- parent_type = left_sym .info.parent_type
1200- } else if left_sym .info is ast.SumType {
1201- parent_type = left_sym .info.parent_type
1202- } else if left_sym .info is ast.Interface {
1203- parent_type = left_sym .info.parent_type
1198+ if final_left_sym .info is ast.Struct {
1199+ parent_type = final_left_sym .info.parent_type
1200+ } else if final_left_sym .info is ast.SumType {
1201+ parent_type = final_left_sym .info.parent_type
1202+ } else if final_left_sym .info is ast.Interface {
1203+ parent_type = final_left_sym .info.parent_type
12041204 }
12051205 if parent_type != 0 {
12061206 type_sym := c.table.sym (parent_type)
@@ -1214,7 +1214,7 @@ pub fn (mut c Checker) method_call(mut node ast.CallExpr) ast.Type {
12141214 if ! has_method {
12151215 has_method = true
12161216 mut embed_types := []ast.Type{}
1217- method , embed_types = c.table.find_method_from_embeds (left_sym , method_name) or {
1217+ method , embed_types = c.table.find_method_from_embeds (final_left_sym , method_name) or {
12181218 if err.msg () != '' {
12191219 c.error (err.msg (), node.pos)
12201220 }
@@ -1226,14 +1226,14 @@ pub fn (mut c Checker) method_call(mut node ast.CallExpr) ast.Type {
12261226 node.from_embed_types = embed_types
12271227 }
12281228 }
1229- if left_sym .kind == .aggregate {
1229+ if final_left_sym .kind == .aggregate {
12301230 // the error message contains the problematic type
12311231 unknown_method_msg = err.msg ()
12321232 }
12331233 }
12341234 if has_method {
12351235 // x is Bar<T>, x.foo() -> x.foo<T>()
1236- rec_sym := c.table.sym (node.left_type)
1236+ rec_sym := c.table.final_sym (node.left_type)
12371237 rec_is_generic := left_type.has_flag (.generic)
12381238 mut rec_concrete_types := []ast.Type{}
12391239 if rec_sym.info is ast.Struct {
0 commit comments