![]() |
Delphi-Version: 10.4 Sydney
Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Ich habe folgenden Code der unter 10.0 Seattle bestens funktioniert hat, unter 10.4 Sydney allerdings streikt:
Delphi-Quellcode:
Wenn
program Project1;
type TSomeClass<T: record> = class abstract(TObject) // end; TSomeRecord = record someValueType: Byte; //someManagedType: IInterface; end; TRecordClass = class abstract(TSomeClass<TSomeRecord>) // end; begin // end.
Delphi-Quellcode:
nun ein Feld vom Typ
TSomeRecord
Delphi-Quellcode:
enthält dann streikt 10.4.
IInterface
Bemängelt wird die Zeile
Delphi-Quellcode:
mit dem Hinweis
TRecordClass = class abstract(TSomeClass<TSomeRecord>)
Zitat:
|
AW: Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Have you turn it off and on again? :spin2:
Hier geht's ohne Probleme. Embarcadero® Delphi 10.4 Version 27.0.40680.4203 Delphi 10.4 Update 2
Delphi-Quellcode:
program Project1;
{$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type TSomeClass<T: record> = class abstract(TObject) public FRecord: T; end; TSomeRecord = record someValueType: Byte; someManagedType: IInterface; end; TRecordClass = class abstract(TSomeClass<TSomeRecord>) // end; begin try Writeln(TSomeClass<TSomeRecord>.ClassName); Writeln(TRecordClass.ClassName); var Günni := TRecordClass.Create; Writeln(Günni.FRecord.someValueType.ToString); Writeln(THandle(Günni.FRecord.someManagedType).ToString); Günni.Free; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end.
Code:
TSomeClass<Project1.TSomeRecord>
TRecordClass 0 0 |
AW: Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Alles klar, gut zu wissen.
Bei mir ist es wohl was älter: Zitat:
|
AW: Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Liste der Anhänge anzeigen (Anzahl: 1)
Was sagt denn dein GetIt Package Manager unter Categories | Patches and Hotfixes?
Da gab es zwei im April und einen im Mai? Anhang 54644 |
AW: Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Sieht irgendwie nach diesem Fehler aus:
![]() |
AW: Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Liste der Anhänge anzeigen (Anzahl: 1)
Also wenn ich das richtig verstehe sollte ich den "10.4.2 Installer for earlier 10.4 Releases 1.0" installieren.
|
AW: Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Jo, trau dich!
|
AW: Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Zitat:
|
AW: Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Richtig.
Delphi-Quellcode:
war nur ein mögliches Beispiel.
IInterface
|
AW: Fehler "Type-Parameter 'T' must be value type" obwohl er es ist
Liste der Anhänge anzeigen (Anzahl: 1)
Zitat:
Gut, dass ich mich zwar getraut habe, aber schon lange nicht mehr so mutig bin, das RAD Studio auf einem echten Pc zu installieren sondern nur noch VMs. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:22 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