Re: [ooc-compiler] SYSTEM.VAL bug?
Brought to you by:
mva
|
From: akarl <fus...@co...> - 2005-09-02 15:16:58
|
Michael van Acken wrote: > On 30/08/05, akarl <fus...@co...> wrote: >>Why is the last statement in Test.Mod invalid? >> >>[src]$ cat Test.Mod >>MODULE Test; >> IMPORT SYSTEM; >> VAR s: SET; n: SHORTINT; >>BEGIN >> n := 1; >> s := SYSTEM.VAL(SET, LONG(LONG(n))); >> s := SYSTEM.VAL(SET, LONG(LONG(1))) > > > For an integer constant, oo2c always uses the smallest integer > type that can hold it. As LONG() is an identity operation, it does > not change the type of integer constants: SIZE(1)=SIZE(LONG(1))=1 > > For a broader discussion of this, please see appendix B of Patrik Reali's > dissertation at http://www.inf.ethz.ch/personal/reali/ OK, thanks. August |