Skip to content
Snippets Groups Projects
  1. Dec 06, 2023
    • Vladislav Zavialov's avatar
      T2T in Patterns (#23739) · 0f0c53a5
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This patch implements the T2T (term-to-type) transformation in patterns.
      Patterns that are checked against a visible forall can now be written
      without the `type` keyword:
      
      	  \(type t) (x :: t) -> ...   -- old
      	  \t (x :: t) -> ...          -- new
      
      The `t` binder is parsed and renamed as a term pattern (Pat), but
      then undergoes a conversion to a type pattern (HsTyPat).
      See the new function pat_to_type_pat in compiler/GHC/Tc/Gen/Pat.hs
      0f0c53a5
  2. Jun 21, 2023
  3. Jun 15, 2023
    • Andrei Borzenkov's avatar
      Report scoped kind variables at the type-checking phase (#16635) · 78cd1132
      Andrei Borzenkov authored
      This patch modifies the renamer to respect ScopedTypeVariables in kind
      signatures. This means that kind variables bound by the outermost
      `forall` now scope over the type:
      
        type F = '[Right @a @() () :: forall a. Either a ()]
        --         ^^^^^^^^^^^^^^^          ^^^
        --          in scope here        bound here
      
      However, any use of such variables is a type error, because we don't
      have type-level lambdas to bind them in Core. This is described in the
      new Note [Type variable scoping errors during type check] in GHC.Tc.Types.
      78cd1132
  4. Apr 30, 2023
  5. Apr 27, 2023
    • Cheng Shao's avatar
      testsuite: add missing annotations for some tests · b174a110
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This patch adds missing annotations (req_th, req_dynamic_lib_support,
      req_rts_linker) to some tests. They were discovered when testing
      wasm32, though it's better to be explicit about what features they
      require, rather than simply adding when(arch('wasm32'), skip).
      b174a110
  6. Feb 21, 2023
    • Ryan Scott's avatar
      Disallow `tagToEnum#` on `type data` types · ff8e99f6
      Ryan Scott authored
      We don't want to allow users to conjure up values of a `type data` type using
      `tagToEnum#`, as these simply don't exist at the value level.
      ff8e99f6
    • Ryan Scott's avatar
      Treat type data declarations as empty when checking pattern-matching coverage · 96dc58b9
      Ryan Scott authored
      The data constructors for a `type data` declaration don't exist at the value
      level, so we don't want GHC to warn users to match on them.
      
      Fixes #22964.
      96dc58b9
    • Ryan Scott's avatar
      Don't generate datacon wrappers for `type data` declarations · 4327d635
      Ryan Scott authored
      Data constructor wrappers only make sense for _value_-level data constructors,
      but data constructors for `type data` declarations only exist at the _type_
      level. This patch does the following:
      
      * The criteria in `GHC.Types.Id.Make.mkDataConRep` for whether a data
        constructor receives a wrapper now consider whether or not its parent data
        type was declared with `type data`, omitting a wrapper if this is the case.
      
      * Now that `type data` data constructors no longer receive wrappers, there is a
        spot of code in `refineDefaultAlt` that panics when it encounters a value
        headed by a `type data` type constructor. I've fixed this with a special case
        in `refineDefaultAlt` and expanded `Note [Refine DEFAULT case alternatives]`
        to explain why we do this.
      
      Fixes #22948.
      4327d635
  7. Feb 02, 2023
    • jeffrey young's avatar
      CI: JavaScript backend runs testsuite · 394b91ce
      jeffrey young authored and Marge Bot's avatar Marge Bot committed
      This MR runs the testsuite for the JS backend. Note that this is a
      temporary solution until !9515 is merged.
      
      Key point: The CI runs hadrian on the built cross compiler _but not_ on
      the bindist.
      
      Other Highlights:
      
       - stm submodule gets a bump to mark tests as broken
       - several tests are marked as broken or are fixed by adding more
       - conditions to their test runner instance.
      
      List of working commit messages:
      
      CI: test cross target _and_ emulator
      
      CI: JS: Try run testsuite with hadrian
      
      JS.CI: cleanup and simplify hadrian invocation
      
      use single bracket, print info
      
      JS CI: remove call to test_compiler from hadrian
      
      don't build haddock
      
      JS: mark more tests as broken
      
      Tracked in #22576
      
      JS testsuite: don't skip sum_mod test
      
      Its expected to fail, yet we skipped it which automatically makes it
      succeed leading to an unexpected success,
      
      JS testsuite: don't mark T12035j as skip
      
      leads to an unexpected pass
      
      JS testsuite: remove broken on T14075
      
      leads to unexpected pass
      
      JS testsuite: mark more tests as broken
      
      JS testsuite: mark T11760 in base as broken
      
      JS testsuite: mark ManyUnbSums broken
      
      submodules: bump process and hpc for JS tests
      
      Both submodules has needed tests skipped or marked broken for th JS
      backend. This commit now adds these changes to GHC.
      
      See:
      
      HPC: hpc/hpc!21
      
      Process: https://github.com/haskell/process/pull/268
      
      remove js_broken on now passing tests
      
      separate wasm and js backend ci
      
      test: T11760: add threaded, non-moving only_ways
      
      test: T10296a add req_c
      
      T13894: skip for JS backend
      
      tests: jspace, T22333: mark as js_broken(22573)
      
      test: T22513i mark as req_th
      
      stm submodule: mark stm055, T16707 broken for JS
      
      tests: js_broken(22374) on unpack_sums_6, T12010
      
      dont run diff on JS CI, cleanup
      
      fixup: More CI cleanup
      
      fix: align text to master
      
      fix: align exceptions submodule to master
      
      CI: Bump DOCKER_REV
      
      Bump to ci-images commit that has a deb11 build with node. Required for
      !9552
      
      testsuite: mark T22669 as js_skip
      
      See #22669
      
      This test tests that .o-boot files aren't created when run in using the
      interpreter backend. Thus this is not relevant for the JS backend.
      
      testsuite: mark T22671 as broken on JS
      
      See #22835
      
      base.testsuite: mark Chan002 fragile for JS
      
      see #22836
      
      revert: submodule process bump
      
      bump stm submodule
      
      New hash includes skips for the JS backend.
      
      testsuite: mark RnPatternSynonymFail broken on JS
      
      Requires TH:
       - see !9779
       - and #22261
      
      compiler: GHC.hs ifdef import Utils.Panic.Plain
      394b91ce
  8. Dec 03, 2022
  9. Nov 08, 2022
    • Ross Paterson's avatar
      Fix TypeData issues (fixes #22315 and #22332) · ce726cd2
      Ross Paterson authored and Marge Bot's avatar Marge Bot committed
      There were two bugs here:
      
      1. Treating type-level constructors as PromotedDataCon doesn't always
         work, in particular because constructors promoted via DataKinds are
         called both T and 'T. (Tests T22332a, T22332b, T22315a, T22315b)
         Fix: guard these cases with isDataKindsPromotedDataCon.
      
      2. Type-level constructors were sent to the code generator, producing
         things like constructor wrappers. (Tests T22332a, T22332b)
         Fix: test for them in isDataTyCon.
      
      Other changes:
      
      * changed the marking of "type data" DataCon's as suggested by SPJ.
      
      * added a test TDGADT for a type-level GADT.
      
      * comment tweaks
      
      * change tcIfaceTyCon to ignore IfaceTyConInfo, so that IfaceTyConInfo
        is used only for pretty printing, not for typechecking. (SPJ)
      ce726cd2
  10. Sep 27, 2022
Loading