[Nice-commit] Nice/src/bossa/syntax Block.java,1.56,1.57 typecheck.nice,1.69,1.70
Brought to you by:
bonniot
From: <ar...@us...> - 2003-05-27 20:43:24
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv27561/F:/nice/src/bossa/syntax Modified Files: Block.java typecheck.nice Log Message: Implemented nullness inference of local constants. fixes bug report #738476. Index: Block.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Block.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Block.java 29 Apr 2003 10:17:07 -0000 1.56 --- Block.java 27 May 2003 20:43:20 -0000 1.57 *************** *** 171,178 **** public static class LocalConstant extends LocalValue { public LocalConstant(LocatedString name, Expression value) { this.value = value; ! this.left = new PolySymbol(name,null); this.last = this; } --- 171,194 ---- public static class LocalConstant extends LocalValue { + static class Symbol extends MonoSymbol + { + Symbol(LocatedString name, Monotype type) + { + super(name, type); + } + + boolean isAssignable() { return false; } + + /* + Index to make the initialization analysis or -1 if + this variable is always initialized. + */ + int index = -1; + } + public LocalConstant(LocatedString name, Expression value) { this.value = value; ! this.left = new LocalConstant.Symbol(name,null); this.last = this; } *************** *** 182,186 **** gnu.bytecode.Type getBytecodeType() { return Types.javaType(left.type); } ! PolySymbol left; public void addNext(LocatedString name, Expression value) --- 198,202 ---- gnu.bytecode.Type getBytecodeType() { return Types.javaType(left.type); } ! MonoSymbol left; public void addNext(LocatedString name, Expression value) Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** typecheck.nice 21 May 2003 15:55:33 -0000 1.69 --- typecheck.nice 27 May 2003 20:43:20 -0000 1.70 *************** *** 594,600 **** decl.value = notNull(decl.value).noOverloading(); mlsub.typing.Polytype type = notNull(decl.value).getType(); - notNull(decl.left).type = type; ! checkMonomorphic(type, decl); } --- 594,599 ---- decl.value = notNull(decl.value).noOverloading(); mlsub.typing.Polytype type = notNull(decl.value).getType(); ! notNull(decl.left).type = checkMonomorphic(type, decl); } |