[Nice-commit] Nice/src/bossa/syntax TypeIdent.java,1.27,1.28 Pattern.java,1.75,1.76
Brought to you by:
bonniot
From: <bo...@us...> - 2003-12-23 10:20:43
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv4805/src/bossa/syntax Modified Files: TypeIdent.java Pattern.java Log Message: Better localize specific error reporting where it belongs. Index: TypeIdent.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/TypeIdent.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** TypeIdent.java 22 Dec 2003 20:28:10 -0000 1.27 --- TypeIdent.java 23 Dec 2003 10:20:40 -0000 1.28 *************** *** 112,125 **** } - public mlsub.typing.TypeConstructor resolveToTCForPattern(TypeMap scope) - { - TypeSymbol res = scope.lookup(name); - - if (res instanceof TypeConstructor) - return (TypeConstructor) res; - - throw User.error(this, this + " is not a declared class or interface"); - } - public TypeSymbol resolvePreferablyToItf(TypeMap scope) { --- 112,115 ---- Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** Pattern.java 23 Oct 2003 18:43:37 -0000 1.75 --- Pattern.java 23 Dec 2003 10:20:40 -0000 1.76 *************** *** 15,18 **** --- 15,19 ---- import java.util.*; import bossa.util.*; + import mlsub.typing.*; import mlsub.typing.TypeConstructor; import mlsub.typing.Monotype; *************** *** 123,127 **** if (typeConstructor != null) { ! tc = typeConstructor.resolveToTCForPattern(scope); if (exactlyAt && !TypeConstructors.instantiable(tc)) User.error --- 124,136 ---- if (typeConstructor != null) { ! mlsub.typing.TypeSymbol sym = ! typeConstructor.resolveToTypeSymbol(scope); ! ! if (sym instanceof TypeConstructor) ! tc = (TypeConstructor) sym; ! else ! throw User.error(this, typeConstructor + ! " is not a declared class or interface"); ! if (exactlyAt && !TypeConstructors.instantiable(tc)) User.error *************** *** 742,746 **** Location.nowhere())); ! mlsub.typing.TypeSymbol sym = Node.getGlobalTypeScope().lookup(name); if (sym == null) --- 751,755 ---- Location.nowhere())); ! TypeSymbol sym = Node.getGlobalTypeScope().lookup(name); if (sym == null) |