lep / jhcr

A compiler to allow hot code reload in WarCraft 3
https://www.hiveworkshop.com/threads/jass-hot-code-reload.313811/
GNU Lesser General Public License v3.0
31 stars 2 forks source link

Compilation error #3

Closed Anchorist closed 1 year ago

Anchorist commented 1 year ago

Using cygwin on Windows

[16 of 21] Compiling Hot.Instruction.Compiler ( Hot\Instruction\Compiler.hs, E:\\jhcr-master\dist-newstyle\build\x86_64-windows\ghc-9.6.2\jass-hot-code-reload-1.0.0\x\jhcr\build\jhcr\jhcr-tmp\Hot\Instruction\Compiler.o )

Hot\Instruction\Compiler.hs:158:14: error: [GHC-88464]
    Variable not in scope:
      forM
        :: [(Ast Var Expr, Type, c0)]
           -> ((Ast Var Expr, Type, Register) -> CompileMonad Instruction)
           -> CompileMonad (t0 Instruction)
    Suggested fix: Perhaps use `iforM' (imported from Control.Lens)
    |
158 |     binds <- forM (zip3 args aTypes [1, 2..]) $ \(arg, typ, pos) -> typed typ $ do
    |              ^^^^

Hot\Instruction\Compiler.hs:176:17: error: [GHC-88464]
    Variable not in scope:
      void :: CompileMonad Register -> CompileMonad ()
    |
176 |     H.Call{} -> void . typed "nothing" $ compileCall e
    |                 ^^^^

Hot\Instruction\Compiler.hs:242:15: error: [GHC-88464]
    Variable not in scope:
      liftM2 :: (a0 -> b0 -> (a0, b0)) -> m a -> m b -> m (a, b)
    Suggested fix:
      Perhaps use one of these:
        `liftA2' (imported from Prelude),
        `lift' (imported from Control.Monad.Reader),
        `liftIO' (imported from Control.Monad.Reader)
    |
242 | bind2 f x y = liftM2 (,) x y >>= uncurry f
    |               ^^^^^^
Error: cabal.exe: Failed to build exe:jhcr from jass-hot-code-reload-1.0.0.

make: *** [GNUmakefile:27: build] Error 1

Using choco on Windows yielded a "no go"

Is my compiler version wrong?

lep commented 1 year ago

Is my compiler version wrong?

Well kinda, it's just too new for me. But i downloaded ghc 9.6 and commited a fix in 271d40d905daf5805f6515b70fd4568f3ffd8bba. Let me know if this works for you now.