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

No error when invalid literal used in IO in repl #4

Closed
olligobber opened this issue Mar 2, 2021 · 1 comment
Closed

No error when invalid literal used in IO in repl #4

olligobber opened this issue Mar 2, 2021 · 1 comment

Comments

@olligobber
Copy link

When an invalid literal is used to create an IO x in ghci, no error occurs.

Prelude> :set -XTemplateHaskell
Prelude> :m Functional.Iota.Free ValidLiterals 
Prelude Functional.Iota.Free ValidLiterals> ($$(valid '(') :: IFree)

<interactive>:3:5: error:
    • Invalid input used for type-safe validated literal!
An error occured during compile-time validation!

    • In the Template Haskell splice $$(valid '(')
      In the expression: ($$(valid '(') :: IFree)
      In an equation for ‘it’: it = ($$(valid '(') :: IFree)

<interactive>:3:5: error:
    • Exception when trying to run compile-time code:
        ValidationFailure "An error occured during compile-time validation!"
      Code: valid '('
    • In the Template Haskell splice $$(valid '(')
      In the expression: ($$(valid '(') :: IFree)
      In an equation for ‘it’: it = ($$(valid '(') :: IFree)
Prelude Functional.Iota.Free ValidLiterals> print ($$(valid '(') :: IFree)
Prelude Functional.Iota.Free ValidLiterals> print ($$(valid 'a') :: IFree)
IFree {fromIFree = 'a'}
Prelude Functional.Iota.Free ValidLiterals>
@olligobber
Copy link
Author

This is an error in GHCi, not validated-literals. See bug report here: https://gitlab.haskell.org/ghc/ghc/-/issues/19470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant