Fix uint properties

This commit is contained in:
James Westman 2021-11-24 14:39:35 -06:00
parent 3f55aae7de
commit f2b7d3bd95
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
6 changed files with 28 additions and 0 deletions

View file

@ -377,6 +377,14 @@ class LiteralValue(Value):
except:
raise CompileError(f"Cannot convert {self.tokens['value']} to integer")
elif isinstance(type, gir.UIntType):
try:
int(self.tokens["value"])
if int(self.tokens["value"]) < 0:
raise Exception()
except:
raise CompileError(f"Cannot convert {self.tokens['value']} to unsigned integer")
elif isinstance(type, gir.FloatType):
try:
float(self.tokens["value"])