diff --git a/pl/modules.yap b/pl/modules.yap index 18a2b9a36..ec73a7bd8 100644 --- a/pl/modules.yap +++ b/pl/modules.yap @@ -294,8 +294,8 @@ module(N) :- % if I don't know what the module is, I cannot do anything to the goal, % so I just put a call for later on. '$module_expansion'(M:G,call(M:G),'$execute_wo_mod'(G,M),_,_,_,_) :- var(M), !. -'$module_expansion'(M:G,G1,GO,_,CM,HM,HVars) :- !, - '$module_expansion'(G,G1,GO,M,CM,HM,HVars). +'$module_expansion'(M:G,G1,GO,_,CM,_,HVars) :- !, + '$module_expansion'(G,G1,GO,M,M,HM,HVars). '$module_expansion'(G, G1, GO, CurMod, MM, HM, HVars) :- '$pred_goal_expansion_on', ( user:goal_expansion(G, CurMod, GI)