Bogue #783
Impossible de transtyper un paramètre non typé
Description
Dans l'implémentation d'une méthode avec un paramètre non typé, il n'est pas possible de transtyper ce paramètre pour lui donner un type.
procedure TestUntypedParam(var Param); begin Integer(Param) := 1; end;
Ce code donne l'erreur suivante :
[Erreur] Types incompatibles : Integer et (non typé)
Le problème peut être contourné en récupérant l'adresse de la variable, avec un pointeur typé :
procedure TestUntypedParam(var Param); var ParamPtr: PInteger; begin ParamPtr := @Param; ParamPtr^ := 1; end;
Related issues
History
#1
Updated by sjrd about 13 years ago
- Category set to Compilateur (SepiCompiler)
- Target version set to 1.0
#2
Updated by sjrd about 13 years ago
- Status changed from Nouveau to Fermé
- % Done changed from 0 to 100
Corrigé dans la révision 452.