From f6c068ba19941d5e175288aef604c5c260bdd6a1 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Sun, 30 Sep 2018 20:54:59 -0300 Subject: [PATCH] Properly warns user when a non-_MEM var is used with _MEM functions. Closes #47 --- source/qb64.bas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/qb64.bas b/source/qb64.bas index ca9412b65..aa533284b 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -17525,6 +17525,11 @@ FUNCTION evaluatetotyp$ (a2$, targettyp AS LONG) Give_Error "Illegal string-number conversion": EXIT FUNCTION END IF + '_MEM? + IF (sourcetyp AND (ISUDT + (1))) <> (targettyp AND (ISUDT + (1))) THEN + Give_Error "Illegal data type conversion (function returns _MEM type)": EXIT FUNCTION + END IF + IF (sourcetyp AND ISSTRING) THEN evaluatetotyp$ = e$ IF (sourcetyp AND ISREFERENCE) THEN