fix(lang): a function named like an engine namespace method's target is refused

Random.range is rng_range, so a package's own rng_range(a, b, c) took
every Random.range call silently. Where the program calls such a method
and the target resolves to a function of its own, the function is
refused, naming the namespace method and the call. Reseed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 05:14:45 +03:00
parent 31d842fca4
commit 73129b59d5
8 changed files with 13668 additions and 13100 deletions

View file

@ -0,0 +1,10 @@
# a function named like the target of one of the engine's namespace methods would take that
# method's calls: Random.range is rng_range, so this rng_range is refused where Random.range is used
program EngineAliasName {
function rng_range(a: int, b: int, c: int) -> int {
return a + b + c
}
entry {
print(Random.range(1, 6))
}
}