mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 12:09:30 +02:00
-- Zusammenführen von r46973 in ».«:
U compiler/htypechk.pas U compiler/ncal.pas A tests/webtbs/tw37796.pp -- Aufzeichnung der Informationen für Zusammenführung von r46973 in ».«: U . git-svn-id: branches/fixes_3_2@47908 -
This commit is contained in:
parent
83f7e7e3dc
commit
7eeaf5d5a0
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -17805,6 +17805,7 @@ tests/webtbs/tw3768.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw3774.pp svneol=native#text/plain
|
tests/webtbs/tw3774.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3777.pp svneol=native#text/plain
|
tests/webtbs/tw3777.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3778.pp svneol=native#text/plain
|
tests/webtbs/tw3778.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw37796.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3780.pp svneol=native#text/plain
|
tests/webtbs/tw3780.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw37806.pp svneol=native#text/pascal
|
tests/webtbs/tw37806.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3782.pp svneol=native#text/plain
|
tests/webtbs/tw3782.pp svneol=native#text/plain
|
||||||
|
@ -1781,6 +1781,7 @@ implementation
|
|||||||
mayberesettypeconvs;
|
mayberesettypeconvs;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
arrayconstructorn,
|
||||||
setconstn,
|
setconstn,
|
||||||
stringconstn,
|
stringconstn,
|
||||||
guidconstn :
|
guidconstn :
|
||||||
@ -2082,6 +2083,7 @@ implementation
|
|||||||
(tstringdef(def_to).encoding=tstringdef(p.resultdef).encoding) then
|
(tstringdef(def_to).encoding=tstringdef(p.resultdef).encoding) then
|
||||||
eq:=te_equal
|
eq:=te_equal
|
||||||
end;
|
end;
|
||||||
|
formaldef,
|
||||||
setdef :
|
setdef :
|
||||||
begin
|
begin
|
||||||
{ set can also be a not yet converted array constructor }
|
{ set can also be a not yet converted array constructor }
|
||||||
|
@ -1205,6 +1205,13 @@ implementation
|
|||||||
(parasym.vardef.typ=setdef) then
|
(parasym.vardef.typ=setdef) then
|
||||||
inserttypeconv(left,parasym.vardef);
|
inserttypeconv(left,parasym.vardef);
|
||||||
|
|
||||||
|
{ if an array constructor can be a set and it is passed to
|
||||||
|
a formaldef, a set must be passed, see also issue #37796 }
|
||||||
|
if (left.nodetype=arrayconstructorn) and
|
||||||
|
(parasym.vardef.typ=formaldef) and
|
||||||
|
(arrayconstructor_can_be_set(left)) then
|
||||||
|
left:=arrayconstructor_to_set(left,false);
|
||||||
|
|
||||||
{ set some settings needed for arrayconstructor }
|
{ set some settings needed for arrayconstructor }
|
||||||
if is_array_constructor(left.resultdef) then
|
if is_array_constructor(left.resultdef) then
|
||||||
begin
|
begin
|
||||||
|
38
tests/webtbs/tw37796.pp
Normal file
38
tests/webtbs/tw37796.pp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
program tformal;
|
||||||
|
{$mode objfpc}
|
||||||
|
|
||||||
|
uses
|
||||||
|
sysutils;
|
||||||
|
|
||||||
|
type
|
||||||
|
TFontStyle = (
|
||||||
|
fsItalic,
|
||||||
|
fsBold,
|
||||||
|
fsUnderlined,
|
||||||
|
fsStrikeOut
|
||||||
|
);
|
||||||
|
TFontStyles = set of TFontStyle;
|
||||||
|
|
||||||
|
var aFS: TFontStyles;
|
||||||
|
|
||||||
|
procedure Any(const Anything);
|
||||||
|
begin
|
||||||
|
aFS:=aFS+TFontStyles(Anything);
|
||||||
|
Writeln(IntToHex(PLongInt(@Anything)^, 8));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure DoIt;
|
||||||
|
begin
|
||||||
|
Any([fsItalic, fsBold]); //unit1.pas(31,25) Error: Variable identifier expected
|
||||||
|
if aFS<>[fsItalic, fsBold] then
|
||||||
|
halt(1);
|
||||||
|
Any(Cardinal([fsItalic, fsBold])); //ok
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
aFS:=[];
|
||||||
|
writeln(Cardinal(aFS));
|
||||||
|
DoIt;
|
||||||
|
writeln(Cardinal(aFS));
|
||||||
|
writeln('ok');
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user