- if nclassdef.mprop2npropdef.has_key(mprop) then
- modelbuilder.error(self, "Error: A property {mprop} is already defined in class {nclassdef.mclassdef.mclass}.")
+ if mclassdef.mprop2npropdef.has_key(mprop) then
+ modelbuilder.error(self, "Error: A property {mprop} is already defined in class {mclassdef.mclass} at line {mclassdef.mprop2npropdef[mprop].location.line_start}.")
+ return false
+ end
+ if mprop isa MMethod and mprop.is_toplevel != (parent isa ATopClassdef) then
+ if mprop.is_toplevel then
+ modelbuilder.error(self, "Error: {mprop} is a top level method.")
+ else
+ modelbuilder.error(self, "Error: {mprop} is not a top level method.")
+ end