Generator uses proper type owner UUID during interface conversion

This commit is contained in:
Sasha Koshka 2024-02-28 12:30:38 -05:00
parent 68be34ddfe
commit 40c5d10d4b
2 changed files with 5 additions and 4 deletions

View File

@ -124,7 +124,7 @@ func (this *generator) generateAssignmentToDestination ( // TODO: add -Val suffi
destTypeBase, irDestLoc, destTypeBase, irDestLoc,
irDestType, name) irDestType, name)
key := entity.Key { key := entity.Key {
Unit: sourceType.Unit(), Unit: sourceType.Type.Unit(),
Name: sourceType.Name, Name: sourceType.Name,
Method: name, Method: name,
} }

View File

@ -44,11 +44,12 @@ func (this *generator) generateMethodCallVal (call *entity.MethodCall) (llvm.Val
// check for methods on named type // check for methods on named type
if sourceType, ok := call.Source.Type().(*entity.TypeNamed); ok { if sourceType, ok := call.Source.Type().(*entity.TypeNamed); ok {
method, err := this.method(entity.Key { methodKey := entity.Key {
Unit: sourceType.Unit(), Unit: sourceType.Type.Unit(),
Name: sourceType.Name, Name: sourceType.Name,
Method: call.Name, Method: call.Name,
}) }
method, err := this.method(methodKey)
if _, notFound := err.(errNotFound); !notFound { if _, notFound := err.(errNotFound); !notFound {
source, err := this.generateExpressionLoc(call.Source) source, err := this.generateExpressionLoc(call.Source)
if err != nil { return nil, err } if err != nil { return nil, err }