Closed ysangkok closed 3 years ago
You seem to have a broken install. A fresh install generally solves these kind of issues.
Or it may be that you need to import more of the Language.*
modules.
Cf #1086 for a similar issue.
I don't think it could be a broken install since I wiped the installation and used make clean
:
cd ~/idris2
rm -rf ~/.idris2/
git pull
make clean
sudo apt install chezscheme
make bootstrap SCHEME=chezscheme
make install
cd ../bug
idris2 --repl test.ipkg
Test> :exec main
Exception: variable LanguageC-45JSONC-45Lexer-lexJSON is not bound
I will now try to experiment with imports.
Ok, by sequentially adding the modules mentioned in the errors, the program now runs. These are the modules I had to add:
import Language.JSON.Lexer
import Text.Lexer
import Language.JSON.String
import Language.JSON.String.Lexer
import Data.String
import Data.List
import Language.JSON.Parser
import Text.Parser
Right I really think it's #1086 again then. We seem to have scoping issues when compiling code that transitively relies on the content of some modules. Which is strange because Idris itself does have this kind of structure too and I don't think we've hit that bug working on Idris proper yet!
Ok, I'll close this then, since it is a duplicate.
Steps to Reproduce
test.ipkg:
src/Test.idr:
Expected Behavior
The program prints "hi".
Observed Behavior
And if I rerun the
idris2 --repl
command:Error: Undefined name unsafePerformIO.