summaryrefslogtreecommitdiff
path: root/avx512-0037785/tests/webtbs/tw38145a.pp
blob: 7c9cc8c8e03a64689e2acc31b92cebfaa20ce0bb (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
{ %NORUN }

program tw38145a;
{$mode delphi}
type
  TMyWrap<T> = record
    Value: T;
    class operator Explicit(const w: TMyWrap<T>): T;
    class operator Implicit(const w: TMyWrap<T>): T;
  end;

class operator TMyWrap<T>.Explicit(const w: TMyWrap<T>): T;
begin
  Result := w.Value;
end;

class operator TMyWrap<T>.Implicit(const w: TMyWrap<T>): T;
begin
  Result := w.Value;
end;

type
  //TString = string[255]; //compiles
  TString = string[254]; //not compiles

var
  MySpec: TMyWrap<TString>;
begin
end.