Re: [BLACKBOX] Another trap during compile

From: [at]} <Chris>
Date: Thu, 21 Oct 2010 11:03:52 +1030

----boundary-LibPST-iamunique-863066586_-_-
Content-type: text/plain

>-----Original Message-----
>From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>Oleg N. Cher
>Sent: Thursday, 21 October 2010 12:38 AM
>To: BLACKBOX{([at]})nowhere.xy
>Subject: [BLACKBOX] Another trap during compile
>
>If you collect traps during compile ;-) You have another:
>
>PROCEDURE A* (): LONGINT;
>BEGIN
> RETURN SYSTEM.VAL(LONGINT, MapRGB())
>END A;
>

I agree it is worth reporting and understand this is probably a test case.
However, you should check to see if the original problem case actually
required the use of a SYSTEM.VAL typecast.

In your test example you don't need, and should not use, a typecast because
the assignment-compatibility rules in Component Pascal also apply to RETURN
statements. The relevant rule is:

--------------------------------------
An expression e of type Te is assignment compatible with a variable v of
type Tv if one of the following conditions hold:
...
2. Te and Tv are numeric or character types and Tv includes Te;
...
--------------------------------------

In this case Tv (LONGINT) includes Te (INTEGER) and the following is
sufficient:

PROCEDURE A* (): LONGINT;
BEGIN
  RETURN MapRGB()
END A;

Regards,
Chris Burrows
CFB Software
http://www.cfbsoftware.com


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-863066586_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt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VJPTi5DSFxwYXINCn0=
----boundary-LibPST-iamunique-863066586_-_---
Received on Thu Oct 21 2010 - 02:33:52 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:29 UTC