[Nice-commit] Nice/src/bossa/syntax pattern.nice,1.3,1.4
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2004-09-15 12:59:07
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29861/F:/nice/src/bossa/syntax Modified Files: pattern.nice Log Message: Fixed bug in creating patterns for method overrides. Index: pattern.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/pattern.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pattern.nice 2 Sep 2004 15:46:32 -0000 1.3 --- pattern.nice 15 Sep 2004 12:58:57 -0000 1.4 *************** *** 30,41 **** //for use in MethodImplementation public Pattern createPattern(?LocatedString name, ?mlsub.typing.TypeConstructor tc, boolean sure) ! { let loc = (name != null) ? name.location() : Location.nowhere(); - if (sure && tc == null) - return new NotNullPattern(name, PrimitiveType.sureTC, loc); if (nice.tools.typing.Types.isPrimitive(tc)) tc = null; if (tc == null) return new VariablePattern(name, loc); --- 30,42 ---- //for use in MethodImplementation public Pattern createPattern(?LocatedString name, ?mlsub.typing.TypeConstructor tc, boolean sure) ! { // TODO: don't generate NotNullPatterns if the overriden domain is sure. let loc = (name != null) ? name.location() : Location.nowhere(); if (nice.tools.typing.Types.isPrimitive(tc)) tc = null; + if (sure && tc == null) + return new NotNullPattern(name, PrimitiveType.sureTC, loc); + if (tc == null) return new VariablePattern(name, loc); *************** *** 625,628 **** --- 626,632 ---- return createPattern(new LocatedString("_", loc)); + if (name.equals("NONNULL")) + return new NotNullPattern(null, PrimitiveType.sureTC, loc); + if (name.equals("NULL")) return createPattern(createNullExp(loc)); |