slicc: fixed error message when the type has no inheritance
This commit is contained in:
parent
5838ed7290
commit
70682e36dd
1 changed files with 4 additions and 3 deletions
|
@ -58,9 +58,10 @@ class MemberExprAST(ExprAST):
|
||||||
else:
|
else:
|
||||||
if "interface" in return_type:
|
if "interface" in return_type:
|
||||||
interface_type = self.symtab.find(return_type["interface"]);
|
interface_type = self.symtab.find(return_type["interface"]);
|
||||||
if self.field in interface_type.data_members:
|
if interface_type != None:
|
||||||
# Return the type of the field
|
if self.field in interface_type.data_members:
|
||||||
return interface_type.data_members[self.field].type
|
# Return the type of the field
|
||||||
|
return interface_type.data_members[self.field].type
|
||||||
self.error("Invalid object field: " +
|
self.error("Invalid object field: " +
|
||||||
"Type '%s' does not have data member %s" % \
|
"Type '%s' does not have data member %s" % \
|
||||||
(return_type, self.field))
|
(return_type, self.field))
|
||||||
|
|
Loading…
Reference in a new issue