diff --git a/sources/zweic/Analyzer.scala b/sources/zweic/Analyzer.scala index 87d138e..0581029 100755 --- a/sources/zweic/Analyzer.scala +++ b/sources/zweic/Analyzer.scala @@ -87,8 +87,8 @@ ownerClass.lookupMethod(name.name) match { case Some(m) => - //TODO: check that returntype is subtype of old returntype and args are subtypes of old args - checkSubtype(tree.pos, "redefinition of class method '"+name+"' has incompatible returntype", m.restype, rt); + //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); 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) +