gir: Fix assignable_to for template types

If we don't know the template's parent type, we should be able to assign
it to an extern type, since we don't know anything about that either.
This commit is contained in:
James Westman 2024-07-26 21:38:17 -05:00
parent 3a712af4dd
commit 24eed1048e

View file

@ -721,7 +721,7 @@ class TemplateType(GirType):
# we don't know the template type's interfaces, assume yes
return True
elif self.parent is None or isinstance(self.parent, ExternType):
return isinstance(other, Class)
return isinstance(other, Class) or isinstance(other, ExternType)
else:
return self.parent.assignable_to(other)