[Nice-commit] Nice/src/bossa/syntax Pattern.java,1.92,1.93
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-10-11 15:22:47
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15099/src/bossa/syntax Modified Files: Pattern.java Log Message: Allow abstract interfaces as additional tags in method implementations. Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** Pattern.java 15 Sep 2004 00:47:31 -0000 1.92 --- Pattern.java 11 Oct 2004 15:21:34 -0000 1.93 *************** *** 38,41 **** --- 38,42 ---- TypeConstructor tc; TypeConstructor tc2; + mlsub.typing.Interface itf2; // The class constraint verified by this pattern. *************** *** 109,113 **** if (additional != null) { ! tc2 = additional.resolveToTC(scope); additional = null; } --- 110,123 ---- if (additional != null) { ! TypeSymbol sym = additional.resolveToTypeSymbol(scope); ! ! if (sym instanceof TypeConstructor) ! tc2 = (TypeConstructor) sym; ! else if (sym instanceof mlsub.typing.Interface) ! itf2 = (mlsub.typing.Interface) sym; ! else ! User.error(additional, ! additional + " should be a class or an interface"); ! additional = null; } *************** *** 220,223 **** --- 230,235 ---- if (tc2 != null) Typing.leq(tc2, rawType); + else if (itf2 != null) + Typing.assertImp(rawType.head(), itf2, false); } |