diff --git a/sources/zweic/Analyzer.scala b/sources/zweic/Analyzer.scala index a9a3f76..2ae6212 100755 --- a/sources/zweic/Analyzer.scala +++ b/sources/zweic/Analyzer.scala @@ -76,6 +76,11 @@ val paramtypes = for ( val f <- args ) yield { //TODO: check that there isn't already a class field with the same name + myVarScope.get(f.name.name) match { + case Some(m) => + Report.error(f.pos, "an argument with the name '" + f.name.name + "' exists already"); + case None => () + } val at = analyzeType(f.typ); f.name.sym = VarSymbol(f.pos, f.name.name, at); myVarScope = myVarScope + f.name.name -> f.name.sym.asInstanceOf[VarSymbol];