[Nice-commit] Nice/src/bossa/syntax typecheck.nice,1.108,1.109 tools.nice,1.44,1.45
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-08-06 17:46:42
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12662/src/bossa/syntax Modified Files: typecheck.nice tools.nice Log Message: Fix array dimensions being overloaded symbols. Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** tools.nice 5 Aug 2004 10:45:30 -0000 1.44 --- tools.nice 6 Aug 2004 17:46:32 -0000 1.45 *************** *** 297,303 **** mlsub.typing.Polytype longPolytype() = native PrimitiveType.longPolytype; mlsub.typing.Monotype boolType() = native PrimitiveType.boolType; mlsub.typing.Monotype longType() = native PrimitiveType.longType; // Local Variables: ! // nice-xprogram: "../bin/nicec -d ../classes --sourcepath=../src" // End: --- 297,304 ---- mlsub.typing.Polytype longPolytype() = native PrimitiveType.longPolytype; mlsub.typing.Monotype boolType() = native PrimitiveType.boolType; + mlsub.typing.Monotype intType() = native PrimitiveType.intType; mlsub.typing.Monotype longType() = native PrimitiveType.longType; // Local Variables: ! // nice-xprogram: "../bin/nicec -d ../classes" // End: Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** typecheck.nice 5 Aug 2004 10:45:30 -0000 1.108 --- typecheck.nice 6 Aug 2004 17:46:32 -0000 1.109 *************** *** 630,642 **** { Expression[] knownDimensions = notNull(e.knownDimensions); ! typecheckExps(cast(knownDimensions)); for (int i=0; i<knownDimensions.length; i++) { ! Expression dim = knownDimensions[i]; try{ ! Typing.leq(dim.getType(), PrimitiveType.intPolytype); } catch(TypingEx ex){ ! if (notNullError(ex, dim, dim.toString())) bossa.util.User.error(dim, "" + dim + " should be an integer"); --- 630,643 ---- { Expression[] knownDimensions = notNull(e.knownDimensions); ! for (int i=0; i<knownDimensions.length; i++) { ! Expression dim = knownDimensions[i] = ! knownDimensions[i].resolveOverloading(PrimitiveType.intPolytype); try{ ! checkAssignment(PrimitiveType.intType, dim); } catch(TypingEx ex){ ! if (notNullError(ex, dim, dim.toString())) bossa.util.User.error(dim, "" + dim + " should be an integer"); |