Fix mypy errors & other bugs

This commit is contained in:
James Westman 2023-03-12 20:56:31 -05:00
parent 98ba7d467a
commit 90001bd885
2 changed files with 12 additions and 12 deletions

View file

@ -104,8 +104,8 @@ class LiteralExpr(Expr):
def type_complete(self) -> bool:
from .values import IdentLiteral
if isinstance(self.literal, IdentLiteral):
if object := self.root.objects_by_id.get(self.ident):
if isinstance(self.literal.value, IdentLiteral):
if object := self.root.objects_by_id.get(self.literal.value.ident):
return not isinstance(object, Template)
return True
@ -141,7 +141,7 @@ class LookupOp(InfixExpr):
],
)
if isinstance(self.lhs.type, UncheckedType):
if isinstance(self.lhs.type, UncheckedType) or not self.lhs.type_complete:
return
elif not isinstance(self.lhs.type, gir.Class) and not isinstance(