@@ -40,7 +40,6 @@ func checkIfCondition(r *analyzer.AnalyzerNode, condition ast.Expression, cm *mo
4040 r .Program .FullPath ,
4141 nil ,
4242 "if statement missing condition" ,
43- "if statement missing condition" ,
4443 report .TYPECHECK_PHASE ,
4544 )
4645 return
@@ -93,7 +92,6 @@ func checkAlternative(r *analyzer.AnalyzerNode, alternative ast.Node, cm *module
9392 r .Program .FullPath ,
9493 alternative .Loc (),
9594 fmt .Sprintf ("invalid alternative in if statement: %T" , alternative ),
96- fmt .Sprintf ("invalid alternative in if statement: %T" , alternative ),
9795 report .TYPECHECK_PHASE ,
9896 )
9997 }
@@ -108,7 +106,6 @@ func checkReturnStmt(r *analyzer.AnalyzerNode, returnStmt *ast.ReturnStmt, cm *m
108106 r .Program .FullPath ,
109107 returnStmt .Loc (),
110108 fmt .Sprintf ("function must return a value of type %q" , expectedReturnType ),
111- fmt .Sprintf ("function must return a value of type %q" , expectedReturnType ),
112109 report .TYPECHECK_PHASE ,
113110 )
114111 }
@@ -133,7 +130,6 @@ func checkReturnStmt(r *analyzer.AnalyzerNode, returnStmt *ast.ReturnStmt, cm *m
133130 r .Program .FullPath ,
134131 returnStmt .Loc (),
135132 "void function cannot return a value" ,
136- "void function cannot return a value" ,
137133 report .TYPECHECK_PHASE ,
138134 )
139135 return
@@ -144,7 +140,6 @@ func checkReturnStmt(r *analyzer.AnalyzerNode, returnStmt *ast.ReturnStmt, cm *m
144140 rp := r .Ctx .Reports .AddSemanticError (
145141 r .Program .FullPath ,
146142 returnStmt .Loc (),
147- fmt .Sprintf ("cannot return %q in function expecting %q: %s" ,
148143 fmt .Sprintf ("cannot return %q in function expecting %q: %s" ,
149144 returnValueType , expectedReturnType , err .Error ()),
150145 report .TYPECHECK_PHASE ,
@@ -226,7 +221,6 @@ func reportUnreachableCode(r *analyzer.AnalyzerNode, node ast.Node) {
226221 r .Program .FullPath ,
227222 node .Loc (),
228223 "unreachable code after return statement" ,
229- "unreachable code after return statement" ,
230224 report .TYPECHECK_PHASE ,
231225 )
232226}
0 commit comments