if mtype == null then return
end
+ var nexpr = self.n_expr
if mtype == null then
- var nexpr = self.n_expr
if nexpr != null then
if nexpr isa ANewExpr then
mtype = modelbuilder.resolve_mtype(nclassdef, nexpr.n_type)
else
modelbuilder.error(self, "Error: Untyped attribute {mpropdef}")
end
+ else
+ assert ntype != null
+ if nexpr isa ANewExpr then
+ var xmtype = modelbuilder.resolve_mtype(nclassdef, nexpr.n_type)
+ if xmtype == mtype and modelbuilder.toolcontext.opt_warn.value >= 2 then
+ modelbuilder.warning(ntype, "Warning: useless type definition")
+ end
+ end
end
if mtype == null then return