[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] TestCase20
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] TestCase20 |
Date: |
Tue, 11 Jan 2011 08:31:06 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
<address@hidden> writes:
> % gm2 -I../../gm2.lib0 -c -fiso TestCase20a.mod
> TestCase20b.def:10:11: error: error found while compiling the program
> module
> TestCase20b.def:10:11:problem in parameter 1, PROCEDURE DoSeq (uslov:
> Uslov) ;
> TestCase20b.def:10:11:item being passed is 'TrueBolan': BOOLEAN
> TestCase20b.def:10:11:parameter mismatch: identifier with an
> incompatible type is being passed to this procedure
> TestCase20a.mod:12:3: error: error found while compiling the program
> module
> TestCase20a.mod:12:3:problem in parameter 1, PROCEDURE DoSeq (uslov:
> Uslov) ;
> TestCase20a.mod:12:3:item being passed is 'TrueBolan': BOOLEAN
> TestCase20a.mod:12:3:parameter mismatch: identifier with an
> incompatible type is being passed to this procedure
>
> % cat TestCase20*(mod|def)
> MODULE TestCase20a;
>
> IMPORT
> TestCase20b;
>
> PROCEDURE TrueBolan (): BOOLEAN;
> BEGIN
> RETURN TRUE;
> END TrueBolan;
>
> BEGIN
> TestCase20b.DoSeq(TrueBolan);
> END TestCase20a.
> DEFINITION MODULE TestCase20b;
>
> IMPORT
> TestCase20;
>
> CONST
(* should be a TYPE ? *)
> Uslov = TestCase20.Uslov;
CONST
> True = TestCase20.Uslov;
>
> PROCEDURE DoSeq(uslov: Uslov);
>
> END TestCase20b.
>
> DEFINITION MODULE TestCase20;
>
> TYPE
> Uslov = PROCEDURE(): BOOLEAN;
>
> PROCEDURE True(): BOOLEAN;
>
> END TestCase20.
Hi,
I think the code is invalid - shouldn't the Uslov CONST declaration be a
TYPE? If so the compiler should issue a sensible error message - whereas
currently it gives a misleading error,
regards,
Gaius
- Re: [Gm2] TestCase20,
Gaius Mulley <=