File tree 1 file changed +11
-4
lines changed
src/main/java/org/fulib/scenarios/visitor/resolve
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -510,12 +510,19 @@ else if (name.contains("++"))
510
510
private void checkForExisting (Scope par , String name , Position position )
511
511
{
512
512
final Decl existing = par .resolve (name );
513
- if (existing ! = null )
513
+ if (existing = = null )
514
514
{
515
- par .report (error (position , "variable.redeclaration" , name )
516
- .note (note (position , "variable.redeclaration.hint" ))
517
- .note (note (existing .getPosition (), "variable.declaration.first" , name )));
515
+ return ;
518
516
}
517
+
518
+ final Marker error = error (position , "variable.redeclaration" , name );
519
+ error .note (note (position , "variable.redeclaration.hint" ));
520
+ final Position existingPosition = existing .getPosition ();
521
+ if (existingPosition != null )
522
+ {
523
+ error .note (note (existingPosition , "variable.declaration.first" , name ));
524
+ }
525
+ par .report (error );
519
526
}
520
527
521
528
private static String findUnique (String name , Scope par )
You can’t perform that action at this time.
0 commit comments