summaryrefslogtreecommitdiff
path: root/tests/webtbf/tw25504.pp
blob: 0943da530f25d9052ba331e52376ccf49f88024c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ %fail }
program test;

{$MODE DELPHI}

{ Commenting the next block of code causes compiler to properly show error message in "Data.HelloWorld".
  Otherwise, it throws error:
    Fatal: Compilation aborted
    An unhandled exception occurred at $00437C5E:
    EAccessViolation: Access violation
      $00437C5E
}
type
// {
  TDateTimeStamp = record
    Value: Int64;
  end;

const
  InvalidDateTimeStampValue = Low(Int64);

type
  TDateTimeStampHelper = record helper for TDateTimeStamp
    const Invalid: TDateTimeStamp = (Value: InvalidDateTimeStampValue);
  end;
// }

  TSomeOtherClass = class
  end;

  TSomeClass = class
  private
    Data: array of TSomeOtherClass;
  public
    procedure Test;
  end;

procedure TSomeClass.Test;
begin
  Data.HelloWorld;
end;

begin
end.