From 8c298e0bb192b3d7403c72bc06dc1049c8b62c6b Mon Sep 17 00:00:00 2001 From: paulklint Date: Fri, 6 Sep 2024 20:50:05 +0200 Subject: [PATCH] Added test for md5Hash for identical nested functions --- .../library/lang/rascal/tests/basic/Locations.rsc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/org/rascalmpl/library/lang/rascal/tests/basic/Locations.rsc b/src/org/rascalmpl/library/lang/rascal/tests/basic/Locations.rsc index ef8cb6b5c3b..3843d3081d3 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/basic/Locations.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/basic/Locations.rsc @@ -610,4 +610,17 @@ test bool mvnSchemeTest() { return true; -} \ No newline at end of file +} + +@synopsis{Nested clones in different scopes are acceptable} +int fun_with_clone(int n){ + if(n > 0){ + int h(int n) = 2*n; + return h(n); + } else { + int h(int n) = 2*n; + return h(n); + } +} + +test bool noCodeClone() = fun_with_clone(3) == 6; \ No newline at end of file