@@ -86,7 +86,7 @@ public Object visitPred_decl(KeYParser.Pred_declContext ctx) {
8686 public Object visitFunc_decl (KeYParser .Func_declContext ctx ) {
8787 boolean unique = ctx .UNIQUE () != null ;
8888 Sort retSort = accept (ctx .sortId ());
89- String func_name = accept (ctx .funcpred_name ());
89+ String funcName = accept (ctx .funcpred_name ());
9090 List <Boolean []> whereToBind = accept (ctx .where_to_bind ());
9191 List <Sort > argSorts = accept (ctx .arg_sorts ());
9292 assert argSorts != null ;
@@ -96,11 +96,11 @@ public Object visitFunc_decl(KeYParser.Func_declContext ctx) {
9696 }
9797
9898 Function f = null ;
99- assert func_name != null ;
100- int separatorIndex = func_name .indexOf ("::" );
99+ assert funcName != null ;
100+ int separatorIndex = funcName .indexOf ("::" );
101101 if (separatorIndex > 0 ) {
102- String sortName = func_name .substring (0 , separatorIndex );
103- String baseName = func_name .substring (separatorIndex + 2 );
102+ String sortName = funcName .substring (0 , separatorIndex );
103+ String baseName = funcName .substring (separatorIndex + 2 );
104104 Sort genSort = lookupSort (sortName );
105105 if (genSort instanceof GenericSort ) {
106106 f = SortDependingFunction .createFirstInstance ((GenericSort ) genSort ,
@@ -109,14 +109,15 @@ public Object visitFunc_decl(KeYParser.Func_declContext ctx) {
109109 }
110110
111111 if (f == null ) {
112- f = new Function (new Name (func_name ), retSort , argSorts .toArray (new Sort [0 ]),
112+ f = new Function (new Name (funcName ), retSort , argSorts .toArray (new Sort [0 ]),
113113 whereToBind == null ? null : whereToBind .toArray (new Boolean [0 ]), unique );
114114 }
115115
116116 if (lookup (f .name ()) == null ) {
117117 functions ().add (f );
118118 } else {
119- addWarning (ctx , "Function '" + func_name + "' is already defined!" );
119+ // weigl: agreement on KaKeY meeting: this should be an error.
120+ semanticError (ctx , "Function '" + funcName + "' is already defined!" );
120121 }
121122 return f ;
122123 }
0 commit comments