Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (********
- Delphi XE4 Update1 compiler bug:
- This program properly compiles and works in XE2 but not in XE4u1
- http://qc.embarcadero.com/wc/qcmain.aspx?d=118446
- *******)
- program qc118446;
- {$APPTYPE CONSOLE}
- type
- NestedTest<T> = record
- type TestSetType = set of byte;
- var FTestSet: TestSetType;
- function CalcRaisedBits1: integer;
- function CalcRaisedBits2: integer;
- end;
- function NestedTest<T>.CalcRaisedBits1: integer;
- var
- I: byte;
- begin
- Result := 0;
- for I := Low(I) to High(I) do
- if I in FTestSet then // [dcc32 Error] E2015 Operator not applicable to this operand type
- Inc(Result);
- end;
- function NestedTest<T>.CalcRaisedBits2: integer;
- var
- I: byte;
- begin
- Result := 0;
- for I in FTestSet do // [dcc32 Fatal Error] F2084 Internal Error: E4260
- Inc(Result);
- end;
- var Rec: NestedTest<boolean>;
- begin
- Rec.FTestSet := [10, 20, 30, 40];
- Writeln(4, ' == ', Rec.CalcRaisedBits1, ' == ', Rec.CalcRaisedBits2);
- ReadLn;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement