mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
Expression: Fix some crashes
This commit is contained in:
parent
cd33266452
commit
3416546eac
1 changed files with 5 additions and 3 deletions
|
@ -106,6 +106,7 @@ class ClosureExpr(AstNode):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def gir_type(self):
|
def gir_type(self):
|
||||||
|
if isinstance(self.parent.parent, CastExpr):
|
||||||
return self.parent.parent.gir_type
|
return self.parent.parent.gir_type
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -125,6 +126,7 @@ class LookupOp(InfixExpr):
|
||||||
@property
|
@property
|
||||||
def gir_type(self):
|
def gir_type(self):
|
||||||
if parent_type := self.lhs.gir_type:
|
if parent_type := self.lhs.gir_type:
|
||||||
|
if isinstance(parent_type, gir.Class) or isinstance(parent_type, gir.Interface):
|
||||||
if prop := parent_type.properties.get(self.tokens["property"]):
|
if prop := parent_type.properties.get(self.tokens["property"]):
|
||||||
return prop.type
|
return prop.type
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue