remove variables from scope at the end of a function declaration
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf30/udf30.1.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf30/udf30.1.query.aql
new file mode 100644
index 0000000..73db3b6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf30/udf30.1.query.aql
@@ -0,0 +1,14 @@
+/*
+ * Description  : Declare a UDF and try to use the function parameter outside
+ *                of the function.
+ * Expected Res : Failure
+ * Date         : Apr 10th 2013
+ */
+
+declare function abc($y) {
+ let $x:=3
+ return $x
+};
+
+let $z:=$y
+return $z
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 18ec161..fca38cc 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -4202,6 +4202,12 @@
       </compilation-unit>
     </test-case>
     <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf30">
+        <output-dir compare="Text">udf30</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
       <compilation-unit name="f01">
         <output-dir compare="Text">f01</output-dir>
         <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>