[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warped Name Space



Ahoy Michael van Acken,

> Am 15-Jun-99 schrieb Michael van Acken:
> Hi,
> 
> I was given a strange type declaration and now I am wondering how the
> Oberon compilers out there react on this particular kind of
> strangeness.  I'm especially interested to hear how ETH compilers
> react on this piece of code:
[snip]
> I know that oo2c treats the type alias "B=A" wrong.  Can a forward
> declaration of a pointer base type be resolved through an alias
> declaration?

Why you don`t check it with Mac-PowerPC-Oberon-Compiler (OP)?
Tested it with AmigaOberon V3.2 from A+L-Soft, it doesn`t have any hesitate:

MODULE T;

IMPORT s:SYSTEM;

TYPE
  A* = RECORD
    b*: POINTER TO B
  END;
  B* = A;

  C* = RECORD
    c*: POINTER TO C
  END;

VAR
  a*: A; aPtr*: POINTER TO A; b*: B; bPtr*: POINTER TO B; c*: C; cPtr*: POINTER TO C;
BEGIN
  a := b;(* work *)
(* new *)
  c.c:=cPtr;(* work *)
  a.b:=bPtr;(* work *)
  a.b:=aPtr;(* work *)
(*
  a.b:=s.ADR(b);(* error: Zugewiesener Wert hat falschen Typ *)
  a.b:=cPtr;(* error: Zugewiesener Wert hat falschen Typ *)
*)
END T.

 
Salut,

(S)Marty
-- 
Bugs?  I just programmed undocumented features!
--
Amiga Software Developer: Disk-Cache, Compiler, ixemul... & Ambient Composer
<tsb> http://MartinTauchmann.home.pages.de 
PGP: http://horowitz.surfnet.nl:11371/pks/lookup?op=index&search=0xF74B8D1D
IRC: irc.uni-stuttgart.de Channel `#amiga` NickName `Gaddis`
Location: Freiburg im Breisgau, Baden Wrttemberg / Germany