Support GHC 8.10 #324

Merged
tfausak merged 19 commits from gh-269-ghc-8.10 into master 2020-12-10 03:50:24 +01:00
tfausak commented 2020-11-15 16:10:38 +01:00 (Migrated from github.com)

Continuing work from #312.

Continuing work from #312.
tfausak commented 2020-11-15 18:36:10 +01:00 (Migrated from github.com)

Now there is a legitimate test failure against GHC 8.10. It's related to #48. I don't know enough to fix it.

  src-literatetests/Main.hs:183:3: 
  1) regression issue 48 a
       expected: Right 
                 foo =
                   let a    = b@1
                       cccc = ()
                   in  foo
                 
        but got: Right 
                 foo =
                   let a    = _
                       cccc = ()
                   in  foo
                 

  To rerun use: --match "/regression/issue 48 a/"

  src-literatetests/Main.hs:183:3: 
  2) context free: regression issue 48 a
       expected: Right 
                 foo =
                   let
                     a = b@1
                     cccc = ()
                   in foo
                 
        but got: Right 
                 foo =
                   let
                     a = _
                     cccc = ()
                   in foo

https://github.com/lspitzner/brittany/pull/324/checks?check_run_id=1403080234#step:7:1202

Now there is a legitimate test failure against GHC 8.10. It's related to #48. I don't know enough to fix it. ``` src-literatetests/Main.hs:183:3: 1) regression issue 48 a expected: Right foo = let a = b@1 cccc = () in foo but got: Right foo = let a = _ cccc = () in foo To rerun use: --match "/regression/issue 48 a/" src-literatetests/Main.hs:183:3: 2) context free: regression issue 48 a expected: Right foo = let a = b@1 cccc = () in foo but got: Right foo = let a = _ cccc = () in foo ``` https://github.com/lspitzner/brittany/pull/324/checks?check_run_id=1403080234#step:7:1202
expipiplus1 commented 2020-11-20 14:45:10 +01:00 (Migrated from github.com)

Now there is a legitimate test failure against GHC 8.10. It's related to #48. I don't know enough to fix it.

Looking at --dump-full-ast from brittany with 8.8 and brittany with 8.10, we can see a difference:

where 8.8 returns:

[ A Just (Ann (DP (0,-1)) [] [] [] Nothing Nothing)
    GRHS
      NoExt
      []
      A Just (Ann (DP (0,1)) [] [] [((G AnnAt),DP (0,0))] Nothing Nothing)
        EAsPat
          NoExt
          A Just (Ann (DP (0,0)) [] [] [((G AnnVal),DP (0,0))] Nothing Nothing)
            Unqual {OccName: b}
          A Just (Ann (DP (0,0)) [] [] [((G AnnVal),DP (0,0))] Nothing Nothing)
            HsOverLit
              NoExt
              OverLit
                NoExt
                HsIntegral
                  IL
                    SourceText "1"
                    False
                    1
                HsLit
                  NoExt
                  HsString
                    SourceText "noExpr"
                    {FastString: "noExpr"}
]

8.10 returns a hole!

[ A Just (Ann (DP (0,-1)) [] [] [] Nothing Nothing)
    GRHS
      NoExtField
      []
      A Just (Ann (DP (0,1)) [] [] [((G AnnVal),DP (0,0))] Nothing Nothing)
        HsUnboundVar
          NoExtField
          TrueExprHole {OccName: _}
]

It's also not valid syntax as ghci tells us:

λ> b = a@()

<interactive>:3:5: error:
    Pattern syntax in expression context: a@()
    Type application syntax requires a space before '@'

I think it's fine to remove this test (or correct it so that it has the space before the @)

> Now there is a legitimate test failure against GHC 8.10. It's related to #48. I don't know enough to fix it. Looking at `--dump-full-ast` from brittany with 8.8 and brittany with 8.10, we can see a difference: where 8.8 returns: ```haskell [ A Just (Ann (DP (0,-1)) [] [] [] Nothing Nothing) GRHS NoExt [] A Just (Ann (DP (0,1)) [] [] [((G AnnAt),DP (0,0))] Nothing Nothing) EAsPat NoExt A Just (Ann (DP (0,0)) [] [] [((G AnnVal),DP (0,0))] Nothing Nothing) Unqual {OccName: b} A Just (Ann (DP (0,0)) [] [] [((G AnnVal),DP (0,0))] Nothing Nothing) HsOverLit NoExt OverLit NoExt HsIntegral IL SourceText "1" False 1 HsLit NoExt HsString SourceText "noExpr" {FastString: "noExpr"} ] ``` 8.10 returns a hole! ```haskell [ A Just (Ann (DP (0,-1)) [] [] [] Nothing Nothing) GRHS NoExtField [] A Just (Ann (DP (0,1)) [] [] [((G AnnVal),DP (0,0))] Nothing Nothing) HsUnboundVar NoExtField TrueExprHole {OccName: _} ] ``` It's also not valid syntax as ghci tells us: ``` λ> b = a@() <interactive>:3:5: error: Pattern syntax in expression context: a@() Type application syntax requires a space before '@' ``` I think it's fine to remove this test (or correct it so that it has the space before the `@`)
expipiplus1 commented 2020-11-20 14:47:53 +01:00 (Migrated from github.com)

It's surprising to me that the AST can even represent this, although perhaps it's useful for error messages or something

It's surprising to me that the AST can even represent this, although perhaps it's useful for error messages or something
tfausak commented 2020-11-20 14:49:45 +01:00 (Migrated from github.com)

or correct it so that it has the space before the @

👍

> or correct it so that it has the space before the `@` 👍
expipiplus1 commented 2020-11-20 15:57:05 +01:00 (Migrated from github.com)

Need to update the supported GHC versions in the readme

Need to update the supported GHC versions in the readme
tfausak commented 2020-11-23 14:09:48 +01:00 (Migrated from github.com)

I should make sure there are stack.yaml files for each configuration. Then I think this will be ready to go.

I should make sure there are `stack.yaml` files for each configuration. Then I think this will be ready to go.
expipiplus1 commented 2020-12-09 05:22:24 +01:00 (Migrated from github.com)

@tfausak would you like any help with this release?

@tfausak would you like any help with this release?
tfausak commented 2020-12-09 18:32:52 +01:00 (Migrated from github.com)

Sorry! Thanks for the ping. I don't need any help with this, I just have to actually do it. With any luck I should be able to spend some time on it in the next few days.

Sorry! Thanks for the ping. I don't need any help with this, I just have to actually do it. With any luck I should be able to spend some time on it in the next few days.
Sign in to join this conversation.
There is no content yet.