can not pass array as parameter if array is off subtype of another type
Original Reporter info from Mantis: Gennady Agranov
-
Reporter name: Gennady Agranov
Original Reporter info from Mantis: Gennady Agranov
- Reporter name: Gennady Agranov
Description:
program Test will compile under Delphi, but not after FPC
fpc Test.pas
Free Pascal Compiler version 2.7.1 [2014/12/27] for x86_64
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Win64 for x64
Compiling Test.pas
Test.pas(21,3) Error: Operation "-" not supported for types "SubType" and "SubType"
Test.pas(22,4) Fatal: Syntax error, "." expected but ";" found
Fatal: Compilation aborted
Error: c:\development\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode
Steps to reproduce:
Compile:
program Test;
type
FullType = (Unknown,Stiletto,Vanguard);
SubType = Stiletto..Vanguard;
const
full_choices: array[FullType] of String = ('U','S','V');
sub_choices: array[SubType] of String = ('S', 'V');
procedure abc(choices: array of String);
begin
end;
begin
abc(full_choices);
abc(sub_choices);
end;
end.
Mantis conversion info:
- Mantis ID: 27256
- Fixed in version: 3.0.1
- Fixed in revision: 32621 (#e926169f)