[Nice-commit] Nice/src/bossa/link Compilation.java,1.16,1.17
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-07-13 11:05:51
|
Update of /cvsroot/nice/Nice/src/bossa/link In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14989/src/bossa/link Modified Files: Compilation.java Log Message: Clarify the error message when a native method is not dispatched on the first argument. Index: Compilation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/Compilation.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Compilation.java 20 Mar 2004 15:49:25 -0000 1.16 --- Compilation.java 13 Jul 2004 11:05:40 -0000 1.17 *************** *** 181,194 **** ClassDefinition def = ClassDefinition.get(firstArgument); - if (def == null || ! (def.getImplementation() instanceof NiceClass)) - throw User.error(alt, - m + " is a native method.\n" + - "It can not be overriden because the first argument" + - (firstArgument == null - ? "" - : " " + firstArgument.toString()) - + " is not a class defined in Nice"); ! return (NiceClass) def.getImplementation(); } --- 181,198 ---- ClassDefinition def = ClassDefinition.get(firstArgument); ! if (def != null && def.getImplementation() instanceof NiceClass) ! return (NiceClass) def.getImplementation(); ! ! // Explain that this cannot be done. ! String msg = m + " is a native method.\n"; ! ! if (firstArgument == null) ! msg += "It cannot be implemented without dispatch on the first argument"; ! else ! msg += "It cannot be overriden because the first argument " + ! firstArgument + " is not a class defined in Nice"; ! ! throw User.error(alt, msg); } |