Menu

#137 Formatter bug with generics

Closed
closed-fixed
None
5
2019-12-06
2019-09-12
maf-soft
No

Some generics problems were fixed in 1.3.14, but there are still cases left. They should all be formatted without spaces:

function Something(Callback: TProc < TSomething > = nil): Boolean;
ProcD<T > (xxx);
if Source is TSomething < T > then ...

Discussion

  • Thomas Mueller

    Thomas Mueller - 2019-09-20
    • assigned_to: Thomas Mueller
    • Group: Closed --> New
     
  • maf-soft

    maf-soft - 2019-09-22

    Another one - this works:

    MyFunction<T>.MyMethod();
    

    But adding a line break doesn't:

    MyFunction < T >
      .MyMethod();
    

    Edit: other examples:

    if (FValue is TSomeClass<T>) then  //good
    if FValue is TSomeClass < T > then //bad
    
     

    Last edit: maf-soft 2019-09-25
  • Thomas Mueller

    Thomas Mueller - 2019-09-29

    Fixed first case:
    function Something(Callback: TProc < TSomething > = nil): Boolean;

    But that fix is really ugly. :-(

     
  • Thomas Mueller

    Thomas Mueller - 2019-09-29
     
  • Thomas Mueller

    Thomas Mueller - 2019-09-29

    Fixed in revision #2761

     
  • Thomas Mueller

    Thomas Mueller - 2019-09-29
    • status: open --> closed-fixed
    • Group: New --> Closed
     
  • maf-soft

    maf-soft - 2019-12-06

    Installed 1.3.15, thanks :) - many formatting problems are now correct, but not all...

    1.3.14 Result:= TryGet<string > (AResult);
    1.3.15 Result:= TryGet < string > (AResult);
    
    1.3.14 TMyClass = class(TMyBaseClass<string>)
    1.3.15 TMyClass = class(TMyBaseClass < string > )
    //above is only for <string>, and it happens all over the place in my code, also when calling generic functions
    
    1.3.15 //indenting changed
      GetCharset(Result)['Symbols'].AsObj.AddObj(Key)
      .Add('Description', Descr, Descr <> '')
        .AddList('Images');
    
    //im not sure if it makes sense to have 4 spaces indent here - maybe ok, it's because of the [], I can live with it
      Result:= Format(' %d %d ', [a,
          b]);
    
     

Log in to post a comment.

MongoDB Logo MongoDB