Remove PropertyBinding rule, just use Binding

This commit is contained in:
James Westman 2023-05-22 21:26:07 -05:00
parent abc4e5de65
commit 0a4b5d07a1
16 changed files with 100 additions and 179 deletions

View file

@ -114,7 +114,7 @@ class LookupOp(InfixExpr):
@context(ValueTypeCtx)
def value_type(self) -> ValueTypeCtx:
return ValueTypeCtx(None)
return ValueTypeCtx(None, must_infer_type=True)
@property
def property_name(self) -> str:
@ -133,6 +133,10 @@ class LookupOp(InfixExpr):
@validate("property")
def property_exists(self):
if self.lhs.type is None:
# Literal values throw their own errors if the type isn't known
if isinstance(self.lhs, LiteralExpr):
return
raise CompileError(
f"Could not determine the type of the preceding expression",
hints=[