diff --git a/sources/zweic/Analyzer.scala b/sources/zweic/Analyzer.scala index 0581029..a9a3f76 100755 --- a/sources/zweic/Analyzer.scala +++ b/sources/zweic/Analyzer.scala @@ -88,7 +88,11 @@ ownerClass.lookupMethod(name.name) match { case Some(m) => //TODO: check that old returntype is subtype of new returntype and args are subtypes of old args - checkSubtype(tree.pos, "redefinition of class method '"+name+"' has incompatible returntype", rt, m.restype); + checkSubtype(tree.pos, "redefinition of class method '" + name + "' has incompatible returntype", rt, m.restype); + + if (paramtypes.length != m.paramtypes.length) { + Report.error(tree.pos, "wrong number of arguments for class method '" + name + "' redefinition"); + } if ( !m.paramtypes.zip(paramtypes).forall(x:Pair[Type,Type] => x._1.isSubtype(x._2)) ) { Report.error(tree.pos, "incompatible argument types for class method redefinition: \n required: " + paramtypes.foldLeft("")((a,b)=>a + " " + b) +