@@ -260,24 +260,33 @@ class ParameterDeclarationEntry extends VariableDeclarationEntry {
260260 */
261261 int getIndex ( ) { param_decl_bind ( underlyingElement ( this ) , result , _) }
262262
263+ private string getAnonymousParameterDescription ( ) {
264+ not exists ( getName ( ) ) and
265+ exists ( string idx |
266+ idx =
267+ ( ( getIndex ( ) + 1 ) .toString ( ) + "th" )
268+ .replaceAll ( "1th" , "1st" )
269+ .replaceAll ( "2th" , "2nd" )
270+ .replaceAll ( "3th" , "3rd" )
271+ .replaceAll ( "11st" , "11th" )
272+ .replaceAll ( "12nd" , "12th" )
273+ .replaceAll ( "13rd" , "13th" ) and
274+ if exists ( getCanonicalName ( ) )
275+ then result = "declaration of " + getCanonicalName ( ) + " as anonymous " + idx + " parameter"
276+ else result = "declaration of " + idx + " parameter"
277+ )
278+ }
279+
263280 override string toString ( ) {
264- if exists ( getName ( ) )
265- then result = super .toString ( )
266- else
267- exists ( string idx |
268- idx =
269- ( ( getIndex ( ) + 1 ) .toString ( ) + "th" )
270- .replaceAll ( "1th" , "1st" )
271- .replaceAll ( "2th" , "2nd" )
272- .replaceAll ( "3th" , "3rd" )
273- .replaceAll ( "11st" , "11th" )
274- .replaceAll ( "12nd" , "12th" )
275- .replaceAll ( "13rd" , "13th" )
276- |
277- if exists ( getCanonicalName ( ) )
278- then result = "declaration of " + getCanonicalName ( ) + " as anonymous " + idx + " parameter"
279- else result = "declaration of " + idx + " parameter"
280- )
281+ isDefinition ( ) and
282+ result = "definition of " + getName ( )
283+ or
284+ not isDefinition ( ) and
285+ if getName ( ) = getCanonicalName ( )
286+ then result = "declaration of " + getName ( )
287+ else result = "declaration of " + getCanonicalName ( ) + " as " + getName ( )
288+ or
289+ result = getAnonymousParameterDescription ( )
281290 }
282291
283292 /**
0 commit comments