3 -- Grant of Unlimited Rights
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7 -- unlimited rights in the software and documentation contained herein.
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
9 -- this public release, the Government intends to confer upon all
10 -- recipients unlimited rights equal to those held by the Government.
11 -- These rights include rights to use, duplicate, release or disclose the
12 -- released technical data and computer software in whole or in part, in
13 -- any manner and for any purpose whatsoever, and to have or permit others
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
25 -- CHECK THAT OVERLOADING RESOLUTION USES THE RULE THAT:
27 -- FOR A DEFAULT ENTRY PARAMETER, THE TYPE OF THE INITIALIZATION
28 -- EXPRESSION MUST MATCH THE PARAMETERS'S EXPLICIT TYPEMARK.
30 -- THE FOUR KINDS OF EXPRESSIONS TESTED HERE ARE:
32 -- (A): A CALL TO AN OVERLOADED FUNCTION.
33 -- (B): AN OVERLOADED OPERATOR SYMBOL.
34 -- (C): AN OVERLOADED (INFIX) OPERATOR.
35 -- (D): AN OVERLOADED ENUMERATION LITERAL.
39 WITH REPORT
; USE REPORT
;
43 TYPE WHOLE
IS NEW INTEGER RANGE 0..INTEGER'LAST;
44 TYPE CITRUS
IS (LEMON
, LIME
, ORANGE
);
45 TYPE HUE
IS (RED
, ORANGE
, YELLOW
);
47 FUNCTION F1
(X
, Y
: INTEGER) RETURN INTEGER IS
52 FUNCTION F1
(X
, Y
: WHOLE
) RETURN WHOLE
IS
57 FUNCTION F1
(X
, Y
: INTEGER) RETURN HUE
IS
62 FUNCTION F1
(X
, Y
: INTEGER) RETURN CITRUS
IS
68 TEST
("C87B45C","OVERLOADED INITIALIZATION EXPRESSIONS" &
69 " IN DEFAULT ENTRY PARAMETERS");
72 FUNCTION "*" (X
, Y
: INTEGER) RETURN INTEGER
75 FUNCTION "*" (X
, Y
: WHOLE
) RETURN WHOLE
78 FUNCTION "*" (X
, Y
: INTEGER) RETURN HUE
81 FUNCTION "*" (X
, Y
: INTEGER) RETURN CITRUS
85 ENTRY E1
(I1
: INTEGER := F1
(0, 0);
86 W1
: WHOLE
:= F1
(0, 0);
87 C1
: CITRUS
:= F1
(0, 0);
88 H1
: HUE
:= F1
(0, 0);
89 I2
: INTEGER := "*" (0, 0);
90 W2
: WHOLE
:= "*" (0, 0);
91 C2
: CITRUS
:= "*" (0, 0);
92 H2
: HUE
:= "*" (0, 0);
93 I3
: INTEGER := (0 * 0);
94 W3
: WHOLE
:= (0 * 0);
95 C3
: CITRUS
:= (0 * 0);
97 C4
: CITRUS
:= ORANGE
;
103 ACCEPT E1
(I1
: INTEGER := F1
(0, 0);
104 W1
: WHOLE
:= F1
(0, 0);
105 C1
: CITRUS
:= F1
(0, 0);
106 H1
: HUE
:= F1
(0, 0);
107 I2
: INTEGER := "*" (0, 0);
108 W2
: WHOLE
:= "*" (0, 0);
109 C2
: CITRUS
:= "*" (0, 0);
110 H2
: HUE
:= "*" (0, 0);
111 I3
: INTEGER := (0 * 0);
112 W3
: WHOLE
:= (0 * 0);
113 C3
: CITRUS
:= (0 * 0);
115 C4
: CITRUS
:= ORANGE
;
116 H4
: HUE
:= ORANGE
) DO
118 IF I1
/= -1 OR W1
/= 0 OR
119 CITRUS
'POS (C1
) /= 2 OR HUE
'POS (H1
) /= 1 THEN
120 FAILED
("(A): RESOLUTION INCORRECT - FUNCTION");
123 IF I2
/= -1 OR W2
/= 0 OR
124 CITRUS
'POS (C2
) /= 2 OR HUE
'POS (H2
) /= 1 THEN
125 FAILED
("(B): RESOLUTION INCORRECT " &
126 "- OPERATOR SYMBOL");
129 IF I3
/= -1 OR W3
/= 0 OR
130 CITRUS
'POS (C3
) /= 2 OR HUE
'POS (H3
) /= 1 THEN
131 FAILED
("(C): RESOLUTION INCORRECT - INFIX " &
135 IF CITRUS
'POS (C4
) /= 2 OR HUE
'POS (H4
) /= 1 THEN
136 FAILED
("(D): RESOLUTION INCORRECT - " &
137 "ENUMERATION LITERAL");