mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 02:07:53 +02:00
* fix for Mantis #34332: allow 2 parameter form of Copy also for ShortString variables
+ added test git-svn-id: trunk@39802 -
This commit is contained in:
parent
0e6c072365
commit
bf91991bae
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16252,6 +16252,7 @@ tests/webtbs/tw34239.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw34287.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3429.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3433.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34332.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3435.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3441.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3443.pp svneol=native#text/plain
|
||||
|
@ -1834,7 +1834,7 @@ implementation
|
||||
begin
|
||||
{ generic fallback that will give an error if a wrong
|
||||
type is passed }
|
||||
if (counter=3) then
|
||||
if (counter=3) or (counter=2) then
|
||||
resultdef:=cshortstringtype
|
||||
else
|
||||
CGMessagePos(ppn.left.fileinfo,type_e_mismatch);
|
||||
|
14
tests/webtbs/tw34332.pp
Normal file
14
tests/webtbs/tw34332.pp
Normal file
@ -0,0 +1,14 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tw34332;
|
||||
|
||||
{$mode objfpc}{$h+}
|
||||
|
||||
var
|
||||
SS: ShortString;
|
||||
S: String;
|
||||
begin
|
||||
SS := Copy(SS, 1); // << project1.lpr(9,14) Error: Type mismatch
|
||||
S := Copy(S, 1); // << OK
|
||||
SS := Copy(SS, 1, 1); // << OK
|
||||
end.
|
Loading…
Reference in New Issue
Block a user