if not gp.is_init then continue
super_constructors.add(gp)
end
- var gp = sc.get_property_by_name(once ("init".to_symbol))
- if gp != null then
+ var initname = once ("init".to_symbol)
+ if sc.has_global_property_by_name(initname) then
+ var gp = sc.get_property_by_name(initname)
super_inits.add(self[gp])
end
end
end
local_class.nodes.add(self)
else
- local_class = new MMSrcLocalClass(name, self, arity)
- mod.add_local_class(local_class)
+ local_class = new MMSrcLocalClass(mod, name, self, arity)
local_classes[name] = local_class
- var g = mod.global_class_named(name)
- if g == null then
- # Intro
+ if not mod.has_global_class_named(name) then
local_class.new_global
- g = local_class.global
else
- local_class.set_global(g)
+ local_class.set_global(mod.global_class_named(name))
end
end
v.error(self, "Redef error: {prop.local_class}::{prop} redefines {ip.local_class}::{ip} with {isig.arity} parameter(s).")
return
end
+ if v.signature_builder.closure_decls.length != isig.closures.length then
+ v.error(self, "Redef error: {prop.local_class}::{prop} redefines {ip.local_class}::{ip} with {isig.arity} closure(s).")
+ return
+ end
for p in v.signature_builder.params do
var t = isig[p.position]
p.stype = t
end
s = isig
prop.signature = s
+ #print "s is null"
end
+ var nberr = v.tc.error_count
+ #print "Check {prop.local_class}::{prop}{s} vs {ip.local_class}::{ip}{isig}"
+ #print "s={s.object_id} isig={isig.object_id} isigorig={i.signature.object_id}"
+
#print "orig signature: {i.signature.recv} . {i.signature}"
#print "inh signature: {isig.recv} . {isig}"
#print "redef signature: {s.recv} . {s}"
v.error(self, "Redef error: The function {prop.local_class}::{prop} redefines the procedure {ip.local_class}::{ip}.")
else if srt != null and isrt != null and not srt < isrt then
v.error(self, "Redef error: Expected {isrt} (as in {ip.local_class}::{ip}), got {srt} in {prop.local_class}::{prop}.")
+ else if not s < isig and nberr == v.tc.error_count then
+ # Systematic fallback for conformance check
+ v.error(self, "Redef error: Incompatible redefinition of {ip.local_class}::{ip} with {prop.local_class}::{prop}")
else if srt != null and isrt != null and srt != isrt and prop isa MMAttribute then
# FIXME: To remove
v.warning(self, "Redef warning: Expected {isrt} (as in {ip.local_class}::{ip}), got {srt} in {prop.local_class}::{prop}.")
sig = new MMSignature(new Array[MMType], null, v.local_class.get_type)
end
if sig.return_type != null and n_kwbreak != null then
- v.error(self, "Syntax Error: A break bloc cannot have a return value.")
+ v.error(self, "Syntax Error: A break block cannot have a return value.")
end
# Add the finalizer to the closure signature