This fixes #2725, by making it so that `strip_module(Pred, M, P), call(M:P)` doesn't throw an `instanciation_error` when `Pred` isn't in the form `module:predicate`. Now, `strip_module(hello, M, P)` will call `load_context(M)`, which unifies `M` with the topmost module (or `user`). Two new test cases are added: issue2725.pl, which tests the minimal case id(X) --> X. and the strip_module(P, M, _), call(M:P) scenario, and module_resolution, which tests the behavior of strip_module in a few scenarios.
11 lines
314 B
TOML
11 lines
314 B
TOML
args = [
|
|
"-f",
|
|
"--no-add-history",
|
|
"src/tests/module_resolution.pl",
|
|
"-f",
|
|
"-g", "use_module(library(module_resolution))",
|
|
"-g", "get_module(some_predicate, M), write(M), write('\\n')",
|
|
"-g", "module_resolution:get_module(some_predicate, M), write(M), write('\\n')",
|
|
"-g", "halt"
|
|
]
|