[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Another one, type and type equivalence stuff...
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] Another one, type and type equivalence stuff... |
Date: |
Mon, 06 Sep 2010 17:23:38 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Dragiša Durić <address@hidden> writes:
> % gm2 -I. -fiso -c TestCase5.mod
> TestCase5.mod:25:3: error: type incompatibility found between types 'INTEGER'
> and 'My' during an assignment, hint maybe the expression should be converted
> TestCase5.mod:26:3: error: 'cmp' is not recognised as a procedure, check
> declaration or import
> TestCase5.mod:22:3: error: 'cmp' is not recognised as a procedure, check
> declaration or import
>
> What can be interesting, XDS groks it.
> % ../xds/bin/xc "=compile" TestCase5.mod
> XDS Modula-2 v2.40 [x86, v1.50] - build 10.05.2005
> Compiling "TestCase5.mod"
> no errors, no warnings, lines 29, time 0.01
> =========
> MODULE TestCase5;
>
> FROM
> SYSTEM
> IMPORT
> ADDRESS;
>
> TYPE
> Compare = PROCEDURE (ADDRESS, ADDRESS): INTEGER;
> My = Compare;
>
> PROCEDURE MyCmp(arg1, arg2: ADDRESS): INTEGER;
> BEGIN
> IF arg1 = arg2 THEN
> RETURN -1;
> ELSE
> RETURN 0;
> END;
> END MyCmp;
>
> VAR
> cmp: My;
> a, b: ADDRESS;
> BEGIN
> cmp := MyCmp;
> IF cmp(a, b) > 0 THEN
> a := b;
> END;
> END TestCase5.
>
> --
> Dragiša Durić <address@hidden>
Hi Dragiša,
now fixed in the latest cvs - again thanks for the test code.
* gm2/gm2-compiler/M2GenGCC.mod: skip the type of a
procedure variable.
* gm2/gm2-compiler/M2Quads.mod: skip the type of a
procedure variable held in OperandF. Ensure that
assignment compatibility is only checked for procedure
variables in pass 3. Leaving fuller assignment checking
to be done during tree conversion. This fixes a bug
reported by
DragiÅ¡a DuriÄ\207 (dragisa-duric/testcase05/pass/testcase5.mod).
regards,
Gaius
- Re: [Gm2] Another one, type and type equivalence stuff...,
Gaius Mulley <=