[#2242] Added test to check $-variable constness inside rules