Moved TryToString call into ChkAssCompat
authorceriel <none@none>
Thu, 6 Jun 1996 07:47:00 +0000 (07:47 +0000)
committerceriel <none@none>
Thu, 6 Jun 1996 07:47:00 +0000 (07:47 +0000)
lang/m2/comp/typequiv.c
lang/m2/comp/walk.c

index f08a599..1cec5ee 100644 (file)
@@ -26,6 +26,7 @@
 #include       "node.h"
 #include       "warning.h"
 #include       "main.h"
+#include       "Lpars.h"
 
 extern char *sprint();
 
@@ -289,6 +290,9 @@ ChkAssCompat(nd, tp, message)
                Give an error message when it fails
        */
 
+       if ((*nd)->nd_symb == STRING) {
+               TryToString((*nd), tp);
+       }
        return CompatCheck(nd, tp, message, TstAssCompat);
 }
 
index 0940579..05110be 100644 (file)
@@ -854,9 +854,6 @@ WalkStat(nd, exit_label, end_reached)
                           assignment compatible with the result type of the
                           function procedure (See Rep. 9.11).
                        */
-                       if (nd->nd_RIGHT->nd_symb == STRING) {
-                               TryToString(nd->nd_RIGHT, func_type);
-                       }
                        if (!ChkAssCompat(&(nd->nd_RIGHT), func_type, "RETURN")) {
                                break;
                        }
@@ -1014,8 +1011,6 @@ DoAssign(nd)
               ChkVariable(&(nd->nd_LEFT), D_DEFINED))) return;
        tp = nd->nd_LEFT->nd_type;
 
-       if (nd->nd_RIGHT->nd_symb == STRING) TryToString(nd->nd_RIGHT, tp);
-
        if (! ChkAssCompat(&(nd->nd_RIGHT), tp, "assignment")) {
                return;
        }