if mpropdef.bound == null then continue
if not check_virtual_types_circularity(npropdef, mpropdef.mproperty, mclassdef.bound_mtype, mclassdef.mmodule) then
# Invalidate the bound
+ mpropdef.is_broken = true
mpropdef.bound = mclassdef.mmodule.model.null_type
end
end
mtype = mtype.undecorate
if mtype isa MClassType then
vis_type = mtype.mclass.visibility
- mmodule_type = mtype.mclass.intro.mmodule
+ mmodule_type = mtype.mclass.intro_mmodule
else if mtype isa MVirtualType then
vis_type = mtype.mproperty.visibility
mmodule_type = mtype.mproperty.intro_mclassdef.mmodule
res = false
end
end
+ if not res then is_broken = true
return res
end
end
mprop.is_new = n_kwnew != null
if mprop.is_new then mclassdef.mclass.has_new_factory = true
if name == "sys" then mprop.is_toplevel = true # special case for sys allowed in `new` factories
- self.check_redef_keyword(modelbuilder, mclassdef, n_kwredef, false, mprop)
+ if not self.check_redef_keyword(modelbuilder, mclassdef, n_kwredef, false, mprop) then
+ mprop.is_broken = true
+ return
+ end
else
+ if mprop.is_broken then
+ return
+ end
if not self.check_redef_keyword(modelbuilder, mclassdef, n_kwredef, not self isa AMainMethPropdef, mprop) then return
check_redef_property_visibility(modelbuilder, self.n_visibility, mprop)
end
if is_init then
for p, n in mclassdef.mprop2npropdef do
if p != mprop and p isa MMethod and p.name == name then
- check_redef_keyword(modelbuilder, mclassdef, n_kwredef, false, p)
+ if not check_redef_keyword(modelbuilder, mclassdef, n_kwredef, false, p) then
+ mprop.is_broken = true
+ return
+ end
break
end
end
var mclassdef = mpropdef.mclassdef
var mmodule = mclassdef.mmodule
var nsig = self.n_signature
- var mysignature = self.mpropdef.msignature
+ var mysignature = mpropdef.msignature
if mysignature == null then return # Error thus skiped
# Check
if nsig != null then
if not nsig.check_signature(modelbuilder, mclassdef) then
- self.mpropdef.msignature = null # invalidate
+ mpropdef.msignature = null # invalidate
+ mpropdef.is_broken = true
return # Forward error
end
end
var ret_type = mysignature.return_mtype
if ret_type != null and precursor_ret_type == null then
modelbuilder.error(nsig.n_type.as(not null), "Redef Error: `{mpropdef.mproperty}` is a procedure, not a function.")
- self.mpropdef.msignature = null
+ mpropdef.msignature = null
+ mpropdef.is_broken = true
return
end
var node = nsig.n_params[i]
if not modelbuilder.check_sametype(node, mmodule, mclassdef.bound_mtype, myt, prt) then
modelbuilder.error(node, "Redef Error: expected `{prt}` for parameter `{mysignature.mparameters[i].name}'; got `{myt}`.")
- self.mpropdef.msignature = null
+ mpropdef.msignature = null
+ mpropdef.is_broken = true
end
end
end
ret_type = precursor_ret_type
else if not modelbuilder.check_subtype(node, mmodule, mclassdef.bound_mtype, ret_type, precursor_ret_type) then
modelbuilder.error(node, "Redef Error: expected `{precursor_ret_type}` for return type; got `{ret_type}`.")
- self.mpropdef.msignature = null
+ mpropdef.msignature = null
+ mpropdef.is_broken = true
end
end
end
ntype = n_intro.n_type.mtype
end
# check
- if ntype ==null or ntype != n_type.mtype then return
+ if ntype == null or ntype != n_type.mtype or mpropdef == null then return
modelbuilder.advice(n_type, "useless-signature", "Warning: useless type repetition on redefined attribute `{mpropdef.name}`")
end
end