Re: Compiler error "parameter does not match" (a bug?)

From: [at]} <ftkachov{>
Date: Wed, 2 Jul 2003 03:11:41 +0400 (MSK DST)

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

Dear Wojtek,

This is certainly not a bug.
One cannot change the signutare in the overriding method
except by narrowing the receiver type and the function result type.

Stores.Store is a pointer, and In/Externalize are defined with
the pointer as receiver, so one cannot use a VAR record there.

Perhaps if the language now allows one to define
a pointer type extending a record type and vice versa,
it might be logical that it should be allowed
to use either pointer or a variable as the receiver.

But perhaps there are hidden obstacles for that?

Cheers
Fyodor Tkachov

>
> Hello:
>
> here is a short module which does not compile, what looks strange.
> The PT is an extension of Stores.Store. It is a record, not a pointer
> to record. The language report says that it should be allowed, and
> the compiler does not complain about the PT declaration.
>
> The PPT is also an extension of Stores.Store, but this time it is a
> pointer. This is also allowed.
>
> The following citation from the Language Manual suggests that all is fine.
> The base type can be a RECORD or alternatively a pointer. I infer that
> both the PT and PPT declarations are just fine, and the compiler thinks
> the same.
> > Alternatively, a pointer type can be specified as the base type. The
> > record base type of the pointer is used as the base type of the declared
> > record in this case.

>
> So, why does not the following module compile? Excuse me if the answer is
> obvious. I somehow cannot figure this out.
>
> MODULE DanomTest;
> IMPORT Stores, Dialog;
> TYPE
> PT* = RECORD (Stores.Store)
> tree*: Dialog.Tree
> END;
> PPT* = POINTER TO RECORD (Stores.Store)
> tree*: Dialog.Tree
> END;
>
> (*compile error "parameter does not match"*)
> PROCEDURE (VAR pt: PT) Internalize-(VAR rd: Stores.Reader);
> BEGIN (*Internalize*)
> END Internalize;
>
> (*compile error "parameter does not match"*)
> PROCEDURE (VAR pt: PT) Externalize-(VAR wr: Stores.Writer);
> BEGIN (*Externalize*)
> END Externalize;
>
> (*no error*)
> PROCEDURE (ppt: PPT) Internalize-(VAR rd: Stores.Reader);
> BEGIN (*Internalize*)
> END Internalize;
>
> (*no error*)
> PROCEDURE (ppt: PPT) Externalize-(VAR wr: Stores.Writer);
> BEGIN (*Externalize*)
> END Externalize;
>
> END DanomTest.
>
>
>
> Wojtek Skulski skulski{([at]})nowhere.xy
>
> --------------------------------------------
>
> To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
> blackbox-request{([at]})nowhere.xy
>
> To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

>
> Send any problem reports or questions related to this email list to the list owner at
> owner-blackbox{([at]})nowhere.xy
>
> Current posting policy:
>
> a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
>
> b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
>

--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-1987502256_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW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LCBpbiBwYXJ0aWN1bGFyIG92
ZXIgd2Vla2VuZHMgb3IgaG9seWRheXMuXHB9fQAgSQ==


----boundary-LibPST-iamunique-1987502256_-_---
Received on Wed Jul 02 2003 - 01:11:41 UTC

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