summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw2481.pp
blob: ac6a99adcda1c640abe207b4323923caa1da78ee (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
45
{ Source provided for Free Pascal Bug Report 2481 }
{ Submitted by "Eero Tanskanen" on  2003-05-04 }
{ e-mail: yendor@nic.fi }

{$mode objfpc}

Type
  TMoo = Class

    A : Real;
    Constructor Init;

  End;

Var
  Moo : TMoo;

  Operator := (V : Real) B : TMoo;
  Begin
    B:=TMoo.Create;
    B.A := V;
  End;

{$ifdef FPC_HAS_TYPE_EXTENDED}
{ otherwise extended = real = double }
  Operator := (V : Extended) B : TMoo;
  Begin
    B:=TMoo.Create;
    B.A := V;
  End;
{$endif FPC_HAS_TYPE_EXTENDED}

Constructor TMoo.Init;
Begin

  A := 0;

End;

Begin

  Moo := TMoo.Init;
  Moo := 0.2;

End.