Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizer errors with pslua: Impossible subexpressions: IfThenElse #30

Open
Renegatto opened this issue Aug 27, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@Renegatto
Copy link

The error is:

PS Lua: compiling ...
pslua: Impossible subexpressions: IfThenElse
CallStack (from HasCallStack):
  error, called at src/Relude/Debug.hs:296:11 in relude-1.2.1.0-InE73P0BzGI4tF0Ie3lTIC:Relude.Debug
  error, called at lib/Language/PureScript/Backend/Lua/Optimizer.hs:202:17 in pslua-0.1.0.0-2hkO0AwfMEO5Nw1JAHZE53:Language.PureScript.Backend.Lua.Optimizer

How to reproduce

Minimal example I have got:

module Main (main) where

import Prelude (Unit, pure, map)

import Data.Maybe (Maybe(Just, Nothing), maybe)
import Effect (Effect)
import Effect.Exception (throw)

main :: Effect Unit
main =
  maybe
    (throw "Some error")
    pure
    (maybe Nothing Just (map (\x -> x) Nothing))

When compiled as a module (e.g. with no entrypoint)

Environment

Template

Based on github.com/purescript-lua-template/commit/9e0920a74d376e61a35be4f7389a6c2758cc1dd3

Compiler

github:Unisay/purescript-lua?rev=cc32d90b291f3d828747b31424db321a23b8f957

This is the version that still works with purescript-lua-template, see Unisay/purescript-lua-template#1.

Package set

Custom package set, the only difference with the one that purescript-lua-template uses is:

, refs =
  { dependencies = [ "effect", "prelude" ]
  , repo = "https://github.com/Renegatto/purescript-lua-refs.git"
  , version = "1b6264b8cb62563e924eefa690e07ff4efa42f31"
  }

Which contain a fix for #29

@Unisay Unisay self-assigned this Aug 29, 2024
@Unisay Unisay added the bug Something isn't working label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants