roippi
Developer
Background: using import (or a number of other CLI/ASH functions) does not require me to fully qualify the path to a script. I can have files nested in subfolders and just say "import myfile.ash" and it will find it. I like this feature.
Scenario: I have a file in my scripts/ folder called myimport.ash and another file in my scripts/myscripts/ folder called myimport.ash.
In my third script, dostuff.ash, I import <myimport.ash> at the top. There are two myimport.ash within the scope that is searched by KoLMafiaCLI.findScriptFile(), but it just returns the first one it finds (likely just the one in scripts/). If it had not found the one in scripts/ it would have gone on to find the one in scripts/myscripts/.
In any other scope we would throw a parseException, since you tried to define a variable twice in the same scope.
Proposal: trying to import a file that is defined more than once within the searchable namespace throws a runtime exception.
Scenario: I have a file in my scripts/ folder called myimport.ash and another file in my scripts/myscripts/ folder called myimport.ash.
In my third script, dostuff.ash, I import <myimport.ash> at the top. There are two myimport.ash within the scope that is searched by KoLMafiaCLI.findScriptFile(), but it just returns the first one it finds (likely just the one in scripts/). If it had not found the one in scripts/ it would have gone on to find the one in scripts/myscripts/.
In any other scope we would throw a parseException, since you tried to define a variable twice in the same scope.
Proposal: trying to import a file that is defined more than once within the searchable namespace throws a runtime exception.