![]() |
AW: Neuer FixInsight ist da!
Seit vier Tagen gibt's die Version FixInsight 2015.08
![]() |
AW: Neuer FixInsight ist da!
Finally FixInsight 2015.10 is able to suppress a warning for a piece of code (that was discussed on a previous page). It works not for a scope, but for a particular line though.
Example:
Delphi-Quellcode:
So it's just a "FI:<RULENUMBER>" comment.
procedure RestartTimer;
begin FTimer.Enabled := False; FTimer.Enabled := True; //FI:W508 - this warning will be ignored. end; |
AW: Neuer FixInsight ist da!
Neat! That is WAY better than using IFDEF blocks :thumb:
|
AW: Neuer FixInsight ist da!
I would like to announce Christmas bundle. FixInsight and Parnassus Navigator go together.
![]() |
AW: Neuer FixInsight ist da!
I have updated from 2015.10 to 2015.11 and would like to report a few things:
Fatal Parse error caused by the following code:
Delphi-Quellcode:
This did not cause a fatal error in 2015.10
function TSomeClass.calcSomething(const someCount: Integer): Integer;
begin Result := 'REG11111;2;33333333;44444444;55555555'.Length * someCount; // <-- This line [...] end; C110: Getter or setter name is different from property declaration The following code causes a C110. I guess it's because of the "&":
Delphi-Quellcode:
public property
&Register[index: TRegisterIndex]: TRegisterValue read getRegister write setRegister; default; W521 Return value of function might be undefined The following code did not cause this warning in 2015.10:
Delphi-Quellcode:
O802 ResourceString is declared but never used
type TSomeEnum = (uno, dos, tres);
function TSomeClass.getSomeValue(): TSomeEnum; begin if someCondition() then Exit(TSomeEnum.uno) else if someOtherCondition() then Exit(TSomeEnum.dos) else Exit(TSomeEnum.tres); end; That's an excellent idea! :thumb: W528: Variable not used in for-loop This is strange one. The following code produces a W528:
Delphi-Quellcode:
.
unit Unit1;
interface uses System.Generics.Collections, System.SysUtils; type TPair = System.Generics.Collections.TPair<Single, Single>; TPairs = TArray<TPair>; TPairsExporter = class public class function DataAsString(const pairs: TPairs): String; end; implementation uses System.Classes; class function TPairsExporter.DataAsString(const pairs: TPairs): String; var stringBuilder: TStringBuilder; pair: TPair; begin stringBuilder := TStringBuilder.Create(); try for pair in pairs do stringBuilder.Append(pair.Key).Append(sLineBreak); Result := stringBuilder.ToString(); finally stringBuilder.Destroy(); end; end; end. If you remove the ".Append(sLineBreak)", the warning is gone. Oh, and please ignore the fact that using a for..in with records was not the best idea :oops: |
AW: Neuer FixInsight ist da!
Trag die Sachen doch einfach in den
![]() |
AW: Neuer FixInsight ist da!
Consider the following:
Delphi-Quellcode:
Compiles and works fine (unlike other languages). But probably not what you want. I know about
IFirstInterface = interface
procedure doStuff(); end; ISecondInterface = interface procedure doStuff(); end; TImplementation = class(TInterfacedObject, IFirstInterface, ISecondInterface) procedure doStuff(); end; ![]() Opinions? |
AW: Neuer FixInsight ist da!
Was findest du daran denn falsch? Auf diese Weise stellen wir z.B. unterschiedliche Interfaces für Skripte und für DLLs oder interne Zwecke zur Verfügung, die durch die gleiche Klasse implementiert werden. Und auch in verschiedenen Versionen eines Interfaces kann es ja die gleichen Methoden geben. Es ist ja nicht immer alles neu.
Auch in der Windows API findest du z.B. mehrere Versionen mancher Interfaces, die so logischerweise auch gleiche Methoden enthalten können. Das ist ja auch genau der Sinn von Interfaces. Welche Klasse diese implementiert ist egal, und damit auch was die Klasse sonst noch macht. |
AW: Neuer FixInsight ist da!
I agree with Sebastian: This is a perfect example of one of those many advantages that Delphi has compared to other languages. I for myself use this technique quite often.
|
AW: Neuer FixInsight ist da!
Der schöne Günther, thanks, all these false positives are fixed in version 2016.04 :)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:44 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz