[Nice-commit] Nice/src/bossa/syntax typecheck.nice,1.100,1.101
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-07-20 22:37:58
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19902/src/bossa/syntax Modified Files: typecheck.nice Log Message: Take instanceof assertions into account in the typechecker (implements rfe #923854). Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** typecheck.nice 24 Mar 2004 23:44:25 -0000 1.100 --- typecheck.nice 20 Jul 2004 22:37:49 -0000 1.101 *************** *** 201,204 **** --- 201,214 ---- e.arguments.typecheckArgs(); + if (e.isCallTo("assert") && 1 <= e.arguments.size() <= 2) + { + ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfSucceeds = + first_(instanceofInfo(e.arguments.getExp(0))); + + if (instanceofIfSucceeds != null) + instanceofIfSucceeds.foreach(((MonoSymbol variable, mlsub.typing.Monotype type)) => + setVarType(variable, now: type, out: variable.type)); + } + // forces computation of the type if not done. mlsub.typing.Polytype t = e.getType(); *************** *** 1015,1018 **** // Local Variables: ! // nice-xprogram: "$HOME/Nice/bin/nicec -d ../classes" // End: --- 1025,1028 ---- // Local Variables: ! // nice-xprogram: "../bin/nicec -d ../classes" // End: |