Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghc/ghc
  • bgamari/ghc
  • syd/ghc
  • ggreif/ghc
  • watashi/ghc
  • RolandSenn/ghc
  • mpickering/ghc
  • DavidEichmann/ghc
  • carter/ghc
  • harpocrates/ghc
  • ethercrow/ghc
  • mijicd/ghc
  • adamse/ghc
  • alexbiehl/ghc
  • gridaphobe/ghc
  • trofi/ghc
  • supersven/ghc
  • ppk/ghc
  • ulysses4ever/ghc
  • AndreasK/ghc
  • ghuntley/ghc
  • shayne-fletcher-da/ghc
  • fgaz/ghc
  • yav/ghc
  • osa1/ghc
  • mbbx6spp/ghc
  • JulianLeviston/ghc
  • reactormonk/ghc
  • rae/ghc
  • takenobu-hs/ghc
  • michalt/ghc
  • andrewthad/ghc
  • hsyl20/ghc
  • scottgw/ghc
  • sjakobi/ghc
  • angerman/ghc
  • RyanGlScott/ghc
  • hvr/ghc
  • howtonotwin/ghc
  • chessai/ghc
  • m-renaud/ghc
  • brprice/ghc
  • stevehartdata/ghc
  • sighingnow/ghc
  • kgardas/ghc
  • ckoparkar/ghc
  • alp/ghc
  • smaeul/ghc
  • kakkun61/ghc
  • sykloid/ghc
  • newhoggy/ghc
  • toonn/ghc
  • nineonine/ghc
  • Phyx/ghc
  • ezyang/ghc
  • tweag/ghc
  • langston/ghc
  • ndmitchell/ghc
  • rockbmb/ghc
  • artempyanykh/ghc
  • mniip/ghc
  • mynguyenbmc/ghc
  • alexfmpe/ghc
  • crockeea/ghc
  • nh2/ghc
  • vaibhavsagar/ghc
  • phadej/ghc
  • Haskell-mouse/ghc
  • lolotp/ghc
  • spacekitteh/ghc
  • michaelpj/ghc
  • mgsloan/ghc
  • HPCohen/ghc
  • tmobile/ghc
  • radrow/ghc
  • simonmar/ghc
  • _deepfire/ghc
  • Ericson2314/ghc
  • leitao/ghc
  • fumieval/ghc
  • trac-isovector/ghc
  • cblp/ghc
  • xich/ghc
  • ciil/ghc
  • erthalion/ghc
  • xldenis/ghc
  • autotaker/ghc
  • haskell-wasm/ghc
  • kcsongor/ghc
  • agander/ghc
  • Baranowski/ghc
  • trac-dredozubov/ghc
  • 23Skidoo/ghc
  • iustin/ghc
  • ningning/ghc
  • josefs/ghc
  • kabuhr/ghc
  • gallais/ghc
  • dten/ghc
  • expipiplus1/ghc
  • Pluralia/ghc
  • rohanjr/ghc
  • intricate/ghc
  • kirelagin/ghc
  • Javran/ghc
  • DanielG/ghc
  • trac-mizunashi_mana/ghc
  • pparkkin/ghc
  • bollu/ghc
  • ntc2/ghc
  • jaspervdj/ghc
  • JoshMeredith/ghc
  • wz1000/ghc
  • zkourouma/ghc
  • code5hot/ghc
  • jdprice/ghc
  • tdammers/ghc
  • J-mie6/ghc
  • trac-lantti/ghc
  • ch1bo/ghc
  • cgohla/ghc
  • lucamolteni/ghc
  • acairncross/ghc
  • amerocu/ghc
  • chreekat/ghc
  • txsmith/ghc
  • trupill/ghc
  • typetetris/ghc
  • sergv/ghc
  • fryguybob/ghc
  • erikd/ghc
  • trac-roland/ghc
  • setupminimal/ghc
  • Friede80/ghc
  • SkyWriter/ghc
  • xplorld/ghc
  • abrar/ghc
  • obsidiansystems/ghc
  • Icelandjack/ghc
  • adinapoli/ghc
  • trac-matthewbauer/ghc
  • heatsink/ghc
  • dwijnand/ghc
  • Cmdv/ghc
  • alinab/ghc
  • pepeiborra/ghc
  • fommil/ghc
  • luochen1990/ghc
  • rlupton20/ghc
  • applePrincess/ghc
  • lehins/ghc
  • ronmrdechai/ghc
  • leeadam/ghc
  • harendra/ghc
  • mightymosquito1991/ghc
  • trac-gershomb/ghc
  • lucajulian/ghc
  • Rizary/ghc
  • VictorCMiraldo/ghc
  • jamesbrock/ghc
  • andrewdmeier/ghc
  • luke/ghc
  • pranaysashank/ghc
  • cocreature/ghc
  • hithroc/ghc
  • obreitwi/ghc
  • slrtbtfs/ghc
  • kaol/ghc
  • yairchu/ghc
  • Mathemagician98/ghc
  • trac-taylorfausak/ghc
  • leungbk/ghc
  • MichaWiedenmann/ghc
  • chris-martin/ghc
  • TDecki/ghc
  • adithyaov/ghc
  • trac-gelisam/ghc
  • Lysxia/ghc
  • complyue/ghc
  • bwignall/ghc
  • sternmull/ghc
  • sonika/ghc
  • leif/ghc
  • broadwaylamb/ghc
  • myszon/ghc
  • danbroooks/ghc
  • Mechachleopteryx/ghc
  • zardyh/ghc
  • trac-vdukhovni/ghc
  • OmarKhaledAbdo/ghc
  • arrowd/ghc
  • Bodigrim/ghc
  • matheus23/ghc
  • cardenaso11/ghc
  • trac-Athas/ghc
  • mb720/ghc
  • DylanZA/ghc
  • liff/ghc
  • typedrat/ghc
  • trac-claude/ghc
  • jbm/ghc
  • Gertjan423/ghc
  • PHO/ghc
  • JKTKops/ghc
  • kockahonza/ghc
  • msakai/ghc
  • Sir4ur0n/ghc
  • barambani/ghc
  • vishnu.c/ghc
  • dcoutts/ghc
  • trac-runeks/ghc
  • trac-MaxGabriel/ghc
  • lexi.lambda/ghc
  • strake/ghc
  • spavikevik/ghc
  • JakobBruenker/ghc
  • rmanne/ghc
  • gdziadkiewicz/ghc
  • ani/ghc
  • iliastsi/ghc
  • smunix/ghc
  • judah/ghc
  • blackgnezdo/ghc
  • emilypi/ghc
  • trac-bpfoley/ghc
  • muesli4/ghc
  • trac-gkaracha/ghc
  • Kleidukos/ghc
  • nek0/ghc
  • TristanCacqueray/ghc
  • dwulive/ghc
  • mbakke/ghc
  • arybczak/ghc
  • Yang123321/ghc
  • maksbotan/ghc
  • QuietMisdreavus/ghc
  • trac-olshanskydr/ghc
  • emekoi/ghc
  • samuela/ghc
  • josephcsible/ghc
  • dramforever/ghc
  • lpsmith/ghc
  • DenisFrezzato/ghc
  • michivi/ghc
  • jneira/ghc
  • jeffhappily/ghc
  • Ivan-Yudin/ghc
  • nakaji-dayo/ghc
  • gdevanla/ghc
  • galen/ghc
  • fendor/ghc
  • yaitskov/ghc
  • rcythr/ghc
  • awpr/ghc
  • jeremyschlatter/ghc
  • Aver1y/ghc
  • mitchellvitez/ghc
  • merijn/ghc
  • tomjaguarpaw1/ghc
  • trac-NoidedSuper/ghc
  • erewok/ghc
  • trac-junji.hashimoto/ghc
  • adamwespiser/ghc
  • bjaress/ghc
  • jhrcek/ghc
  • leonschoorl/ghc
  • lukasz-golebiewski/ghc
  • sheaf/ghc
  • last-g/ghc
  • carassius1014/ghc
  • eschwartz/ghc
  • dwincort/ghc
  • felixwiemuth/ghc
  • TimWSpence/ghc
  • marcusmonteirodesouza/ghc
  • WJWH/ghc
  • vtols/ghc
  • theobat/ghc
  • BinderDavid/ghc
  • ckoparkar0/ghc
  • alexander-kjeldaas/ghc
  • dme2/ghc
  • philderbeast/ghc
  • aaronallen8455/ghc
  • rayshih/ghc
  • benkard/ghc
  • mpardalos/ghc
  • saidelman/ghc
  • leiftw/ghc
  • ca333/ghc
  • bwroga/ghc
  • nmichael44/ghc
  • trac-crobbins/ghc
  • felixonmars/ghc
  • adityagupta1089/ghc
  • hgsipiere/ghc
  • treeowl/ghc
  • alexpeits/ghc
  • CraigFe/ghc
  • dnlkrgr/ghc
  • kerckhove_ts/ghc
  • cptwunderlich/ghc
  • eiais/ghc
  • hahohihu/ghc
  • sanchayan/ghc
  • lemmih/ghc
  • sehqlr/ghc
  • trac-dbeacham/ghc
  • luite/ghc
  • trac-f-a/ghc
  • vados/ghc
  • luntain/ghc
  • fatho/ghc
  • alexbiehl-gc/ghc
  • dcbdan/ghc
  • tvh/ghc
  • liam-ly/ghc
  • timbobbarnes/ghc
  • GovanifY/ghc
  • shanth2600/ghc
  • gliboc/ghc
  • duog/ghc
  • moxonsghost/ghc
  • zander/ghc
  • masaeedu/ghc
  • georgefst/ghc
  • guibou/ghc
  • nicuveo/ghc
  • mdebruijne/ghc
  • stjordanis/ghc
  • emiflake/ghc
  • wygulmage/ghc
  • frasertweedale/ghc
  • coot/ghc
  • aratamizuki/ghc
  • tsandstr/ghc
  • mrBliss/ghc
  • Anton-Latukha/ghc
  • tadfisher/ghc
  • vapourismo/ghc
  • Sorokin-Anton/ghc
  • basile-henry/ghc
  • trac-mightybyte/ghc
  • AbsoluteNikola/ghc
  • cobrien99/ghc
  • songzh/ghc
  • blamario/ghc
  • aj4ayushjain/ghc
  • trac-utdemir/ghc
  • tangcl/ghc
  • hdgarrood/ghc
  • maerwald/ghc
  • arjun/ghc
  • ratherforky/ghc
  • haskieLambda/ghc
  • EmilGedda/ghc
  • Bogicevic/ghc
  • eddiejessup/ghc
  • kozross/ghc
  • AlistairB/ghc
  • 3Rafal/ghc
  • christiaanb/ghc
  • trac-bit/ghc
  • matsumonkie/ghc
  • trac-parsonsmatt/ghc
  • chisui/ghc
  • jaro/ghc
  • trac-kmiyazato/ghc
  • davidsd/ghc
  • Tritlo/ghc
  • I-B-3/ghc
  • lykahb/ghc
  • AriFordsham/ghc
  • turion1/ghc
  • berberman/ghc
  • christiantakle/ghc
  • zyklotomic/ghc
  • trac-ocramz/ghc
  • CSEdd/ghc
  • doyougnu/ghc
  • mmhat/ghc
  • why-not-try-calmer/ghc
  • plutotulp/ghc
  • kjekac/ghc
  • Manvi07/ghc
  • teo/ghc
  • cactus/ghc
  • CarrieMY/ghc
  • abel/ghc
  • yihming/ghc
  • tsakki/ghc
  • jessicah/ghc
  • oliverbunting/ghc
  • meld/ghc
  • friedbrice/ghc
  • Joald/ghc
  • abarbu/ghc
  • DigitalBrains1/ghc
  • sterni/ghc
  • alexDarcy/ghc
  • hexchain/ghc
  • minimario/ghc
  • zliu41/ghc
  • tommd/ghc
  • jazcarate/ghc
  • peterbecich/ghc
  • alirezaghey/ghc
  • solomon/ghc
  • mikael.urankar/ghc
  • davjam/ghc
  • int-index/ghc
  • MorrowM/ghc
  • nrnrnr/ghc
  • Sonfamm/ghc-test-only
  • afzt1/ghc
  • nguyenhaibinh-tpc/ghc
  • trac-lierdakil/ghc
  • MichaWiedenmann1/ghc
  • jmorag/ghc
  • Ziharrk/ghc
  • trac-MitchellSalad/ghc
  • juampe/ghc
  • jwaldmann/ghc
  • snowleopard/ghc
  • juhp/ghc
  • normalcoder/ghc
  • ksqsf/ghc
  • trac-jberryman/ghc
  • roberth/ghc
  • 1ntEgr8/ghc
  • epworth/ghc
  • MrAdityaAlok/ghc
  • JunmingZhao42/ghc
  • jappeace/ghc
  • trac-Gabriel439/ghc
  • alt-romes/ghc
  • HugoPeters1024/ghc
  • 10ne1/ghc-fork
  • agentultra/ghc
  • Garfield1002/ghc
  • ChickenProp/ghc
  • clyring/ghc
  • MaxHearnden/ghc
  • jumper149/ghc
  • vem/ghc
  • ketzacoatl/ghc
  • Rosuavio/ghc
  • jackohughes/ghc
  • p4l1ly/ghc
  • konsumlamm/ghc
  • shlevy/ghc
  • torsten.schmits/ghc
  • andremarianiello/ghc
  • amesgen/ghc
  • googleson78/ghc
  • InfiniteVerma/ghc
  • uhbif19/ghc
  • yiyunliu/ghc
  • raehik/ghc
  • mrkun/ghc
  • telser/ghc
  • 1Jajen1/ghc
  • slotThe/ghc
  • WinstonHartnett/ghc
  • mpilgrem/ghc
  • dreamsmasher/ghc
  • schuelermine/ghc
  • trac-Viwor/ghc
  • undergroundquizscene/ghc
  • evertedsphere/ghc
  • coltenwebb/ghc
  • oberblastmeister/ghc
  • agrue/ghc
  • lf-/ghc
  • zacwood9/ghc
  • steshaw/ghc
  • high-cloud/ghc
  • SkamDart/ghc
  • PiDelport/ghc
  • maoif/ghc
  • RossPaterson/ghc
  • CharlesTaylor7/ghc
  • ribosomerocker/ghc
  • trac-ramirez7/ghc
  • daig/ghc
  • NicolasT/ghc
  • FinleyMcIlwaine/ghc
  • lawtonnichols/ghc
  • jmtd/ghc
  • ozkutuk/ghc
  • wildsebastian/ghc
  • nikshalark/ghc
  • lrzlin/ghc
  • tobias/ghc
  • fw/ghc
  • hawkinsw/ghc
  • type-dance/ghc
  • rui314/ghc
  • ocharles/ghc
  • wavewave/ghc
  • TheKK/ghc
  • nomeata/ghc
  • trac-csabahruska/ghc
  • jonathanjameswatson/ghc
  • L-as/ghc
  • Axman6/ghc
  • barracuda156/ghc
  • trac-jship/ghc
  • jake-87/ghc
  • meooow/ghc
  • rebeccat/ghc
  • hamana55/ghc
  • Enigmage/ghc
  • kokobd/ghc
  • agevelt/ghc
  • gshen42/ghc
  • chrismwendt/ghc
  • MangoIV/ghc
  • teto/ghc
  • Sookr1/ghc
  • trac-thomasjm/ghc
  • barci2/ghc-dev
  • trac-m4dc4p/ghc
  • dixonary/ghc
  • breakerzirconia/ghc
  • alexsio27444/ghc
  • glocq/ghc
  • sourabhxyz/ghc
  • ryantrinkle/ghc
  • Jade/ghc
  • scedfaliako/ghc
  • martijnbastiaan/ghc
  • trac-george.colpitts/ghc
  • ammarbinfaisal/ghc
  • mimi.vx/ghc
  • lortabac/ghc
  • trac-zyla/ghc
  • benbellick/ghc
  • aadaa-fgtaa/ghc
  • jvanbruegge/ghc
  • archbung/ghc
  • gilmi/ghc
  • mfonism/ghc
  • alex-mckenna/ghc
  • Ei30metry/ghc
  • DiegoDiverio/ghc
  • jorgecunhamendes/ghc
  • liesnikov/ghc
  • akrmn/ghc
  • trac-simplifierticks/ghc
  • jacco/ghc
  • rhendric/ghc
  • damhiya/ghc
  • ryndubei/ghc
  • DaveBarton/ghc
  • trac-Profpatsch/ghc
  • GZGavinZhao/ghc
  • ncfavier/ghc
  • jameshaydon/ghc
  • ajccosta/ghc
  • dschrempf/ghc
  • cydparser/ghc
  • LinuxUserGD/ghc
  • elodielander/ghc
  • facundominguez/ghc
  • psilospore/ghc
  • lachrimae/ghc
  • dylan-thinnes/ghc-type-errors-plugin
  • hamishmack/ghc
  • Leary/ghc
  • lzszt/ghc
  • lyokha/ghc
  • trac-glaubitz/ghc
  • Rewbert/ghc
  • andreabedini/ghc
  • Jasagredo/ghc
  • sol/ghc
  • OlegAlexander/ghc
  • trac-sthibaul/ghc
  • avdv/ghc
  • Wendaolee/ghc
  • ur4t/ghc
  • daylily/ghc
  • boltzmannrain/ghc
  • mmzk1526/ghc
  • trac-fizzixnerd/ghc
  • soulomoon/ghc
  • rwmjones/ghc
  • j14i/ghc
  • tracsis/ghc
  • gesh/ghc
  • flip101/ghc
  • eldritch-cookie/ghc
  • LemonjamesD/ghc
  • pgujjula/ghc
  • skeuchel/ghc
  • noteed/ghc
  • gulin.serge/ghc
  • Torrekie/ghc
  • jlwoodwa/ghc
  • ayanamists/ghc
  • husong998/ghc
  • trac-edmundnoble/ghc
  • josephf/ghc
  • contrun/ghc
  • baulig/ghc
  • edsko/ghc
  • mzschr/ghc-issue-24732
  • ulidtko/ghc
  • Arsen/ghc
  • trac-sjoerd_visscher/ghc
  • crumbtoo/ghc
  • L0neGamer/ghc
  • DrewFenwick/ghc
  • benz0li/ghc
  • MaciejWas/ghc
  • jordanrule/ghc
  • trac-qqwy/ghc
  • LiamGoodacre/ghc
  • isomorpheme/ghc
  • trac-danidiaz/ghc
  • Kariim/ghc
  • MTaimoorZaeem/ghc
  • hololeap/ghc
  • ticat-fp/ghc
  • meritamen/ghc
  • criskell/ghc
  • trac-kraai/ghc
  • aergus/ghc
  • jdral/ghc
  • SamB/ghc
  • Tristian/ghc
  • ywgrit/ghc
  • KatsuPatrick/ghc
  • OsePedro/ghc
  • mpscholten/ghc
  • fp/ghc
  • zaquest/ghc
638 results
Show changes
Commits on Source (6)
  • Cheng Shao's avatar
    testsuite: remove config.use_threads · 633f2799
    Cheng Shao authored and Marge Bot's avatar Marge Bot committed
    This patch simplifies the testsuite driver by removing the use_threads
    config field. It's just a degenerate case of threads=1.
    633f2799
  • Cheng Shao's avatar
    testsuite: use concurrent.futures.ThreadPoolExecutor in the driver · ca6673e3
    Cheng Shao authored and Marge Bot's avatar Marge Bot committed
    The testsuite driver used to create one thread per test case, and
    explicitly use semaphore and locks for rate limiting and
    synchronization. This is a bad practice in any language, and
    occasionally may result in livelock conditions (e.g. #22889). This
    patch uses concurrent.futures.ThreadPoolExecutor for scheduling test
    case runs, which is simpler and more robust.
    ca6673e3
  • Alan Zimmerman's avatar
    EPA: Comment between module and where should be in header comments · f22cce70
    Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
    Do not apply the heuristic to associate a comment with a prior
    declaration for the first declaration in the file.
    
    Closes #22919
    f22cce70
  • Josh Meredith's avatar
    JS generated refs: update testsuite conditions · d69ecac2
    Josh Meredith authored and Marge Bot's avatar Marge Bot committed
    d69ecac2
  • sheaf's avatar
    Bump transformers to 0.6.1.0 · 2ea1a6bc
    sheaf authored and Marge Bot's avatar Marge Bot committed
    This allows us to avoid orphans for Foldable1 instances,
    fixing #22898.
    
    Updates transformers submodule.
    2ea1a6bc
  • Simon Peyton Jones's avatar
    Narrow the dont-decompose-newtype test · 3bb8cc4d
    Simon Peyton Jones authored
    Following #22924 this patch narrows the test that stops
    us decomposing newtypes.  The key change is the use of
    noGivenNewtypeReprEqs in GHC.Tc.Solver.Canonical.canTyConApp.
    
    We went to and fro on the solution, as you can see in #22924.
    The result is carefully documented in
      Note [Decomoposing newtype equalities]
    
    On the way I had revert most of
      commit 3e827c3f
      Author: Richard Eisenberg <rae@cs.brynmawr.edu>
      Date:   Mon Dec 5 10:14:02 2022 -0500
    
        Do newtype unwrapping in the canonicaliser and rewriter
    
        See Note [Unwrap newtypes first], which has the details.
    
    It turns out that
    
    (a) 3e827c3f makes GHC behave worse on some recursive newtypes
        (see one of the tests on this commit)
    (b) the finer-grained test (namely noGivenNewtypeReprEqs) renders
        3e827c3f unnecessary
    3bb8cc4d
Showing
with 471 additions and 311 deletions
......@@ -1974,7 +1974,7 @@ isInjectiveTyCon :: TyCon -> Role -> Bool
isInjectiveTyCon (TyCon { tyConDetails = details }) role
= go details role
where
go _ Phantom = True -- Vacuously; (t1 ~P t2) holes for all t1, t2!
go _ Phantom = True -- Vacuously; (t1 ~P t2) holds for all t1, t2!
go (AlgTyCon {}) Nominal = True
go (AlgTyCon {algTcRhs = rhs}) Representational
= isGenInjAlgRhs rhs
......
......@@ -3700,11 +3700,13 @@ allocatePriorComments ss comment_q mheader_comments =
cmp (L l _) = anchor l <= ss
(newAnns,after) = partition cmp comment_q
comment_q'= after
(prior_comments, decl_comments) = splitPriorComments ss newAnns
(prior_comments, decl_comments)
= case mheader_comments of
Strict.Nothing -> (reverse newAnns, [])
_ -> splitPriorComments ss newAnns
in
case mheader_comments of
Strict.Nothing -> (Strict.Just prior_comments, comment_q', decl_comments)
-- Strict.Nothing -> (Strict.Just [], comment_q', newAnns)
Strict.Just _ -> (mheader_comments, comment_q', reverse newAnns)
allocateFinalComments
......
......@@ -1084,7 +1084,7 @@ can_eq_nc' _rewritten _rdr_env _envs ev eq_rel
-- Decompose type constructor applications
-- NB: we have expanded type synonyms already
can_eq_nc' rewritten _rdr_env _envs ev eq_rel ty1 _ ty2 _
can_eq_nc' _rewritten _rdr_env _envs ev eq_rel ty1 _ ty2 _
| Just (tc1, tys1) <- tcSplitTyConApp_maybe ty1
, Just (tc2, tys2) <- tcSplitTyConApp_maybe ty2
-- we want to catch e.g. Maybe Int ~ (Int -> Int) here for better
......@@ -1092,7 +1092,7 @@ can_eq_nc' rewritten _rdr_env _envs ev eq_rel ty1 _ ty2 _
-- hence no direct match on TyConApp
, not (isTypeFamilyTyCon tc1)
, not (isTypeFamilyTyCon tc2)
= canTyConApp rewritten ev eq_rel tc1 tys1 tc2 tys2
= canTyConApp ev eq_rel tc1 tys1 tc2 tys2
can_eq_nc' _rewritten _rdr_env _envs ev eq_rel
s1@(ForAllTy (Bndr _ vis1) _) _
......@@ -1114,8 +1114,12 @@ can_eq_nc' True _rdr_env _envs ev NomEq ty1 _ ty2 _
-------------------
-- No similarity in type structure detected. Rewrite and try again.
can_eq_nc' False _rdr_env _envs ev eq_rel _ ps_ty1 _ ps_ty2
= rewrite_and_try_again ev eq_rel ps_ty1 ps_ty2
can_eq_nc' False rdr_env envs ev eq_rel _ ps_ty1 _ ps_ty2
= -- Rewrite the two types and try again
do { (redn1@(Reduction _ xi1), rewriters1) <- rewrite ev ps_ty1
; (redn2@(Reduction _ xi2), rewriters2) <- rewrite ev ps_ty2
; new_ev <- rewriteEqEvidence (rewriters1 S.<> rewriters2) ev NotSwapped redn1 redn2
; can_eq_nc' True rdr_env envs new_ev eq_rel xi1 xi1 xi2 xi2 }
----------------------------
-- Look for a canonical LHS. See Note [Canonical LHS].
......@@ -1153,15 +1157,6 @@ can_eq_nc' True _rdr_env _envs ev eq_rel _ ps_ty1 _ ps_ty2
-- No need to call canEqFailure/canEqHardFailure because they
-- rewrite, and the types involved here are already rewritten
-- Rewrite the two types and try again
rewrite_and_try_again :: CtEvidence -> EqRel -> TcType -> TcType -> TcS (StopOrContinue Ct)
rewrite_and_try_again ev eq_rel ty1 ty2
= do { (redn1@(Reduction _ xi1), rewriters1) <- rewrite ev ty1
; (redn2@(Reduction _ xi2), rewriters2) <- rewrite ev ty2
; new_ev <- rewriteEqEvidence (rewriters1 S.<> rewriters2) ev NotSwapped redn1 redn2
; rdr_env <- getGlobalRdrEnvTcS
; envs <- getFamInstEnvs
; can_eq_nc' True rdr_env envs new_ev eq_rel xi1 xi1 xi2 xi2 }
{- Note [Unsolved equalities]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -1407,62 +1402,41 @@ which is easier to satisfy.
Conclusion: we must unwrap newtypes before decomposing them. This happens
in `can_eq_newtype_nc`
But even this is challenging. Here are two cases to consider:
Case 1:
newtype Age = MkAge Int
[G] c
[W] w1 :: IO Age ~R# IO Int
Case 2:
newtype A = MkA [A]
[W] A ~R# [A]
For Case 1, recall that IO is an abstract newtype. Then read Note
[Decomposing newtype equalities]. According to that Note, we should not
decompose w1, because we have an Irred Given. Yet we still want to solve
the wanted! We can do so by unwrapping the (non-abstract) Age newtype
underneath the IO, giving
[W] w2 :: IO Int ~R# IO Int
w1 = (IO unwrap-Age ; w2)
where unwrap-Age :: Age ~R# Int. Now we case solve w2 by reflexivity;
see Note [Eager reflexivity check].
Conclusion: unwrap newtypes (deeply, inside types) in the rewriter:
specifically in GHC.Tc.Solver.Rewrite.rewrite_newtype_app.
Yet for Case 2, deep rewriting would be a disaster: we would loop.
[W] A ~R# [A] ---> {unwrap}
[W] [A] ~R# [[A]]
---> {decompose}
[W] A ~R# [A]
In this case, we just want to unwrap newtypes /at the top level/, allowing us
to succeed via Note [Eager reflexivity check]:
[W] A ~R# [A] ---> {unwrap at top level only}
[W] [A] ~R# [A]
---> {reflexivity} success
Conclusion: to satisfy Case 1 and Case 2, we unwrap
* /both/ at top level, in can_eq_nc'
* /and/ deeply, in the rewriter, rewrite_newtype_app
The former unwraps outer newtypes (when the data constructor is in scope).
The latter unwraps deeply -- but it won't be invoked in Case 2, when we can
recognize an equality between the types [A] and [A] before rewriting
deeply.
This "before" business is delicate -- there is still a real risk of a loop
in the type checker with recursive newtypes -- but I think we're doomed to do
*something* delicate, as we're really trying to solve for equirecursive
type equality. Bottom line for users: recursive newtypes are dangerous.
See also Section 5.3.1 and 5.3.4 of
We did flirt with making the /rewriter/ expand newtypes, rather than
doing it in `can_eq_newtype_nc`. But with recursive newtypes we want
to be super-careful about expanding!
newtype A = MkA [A] -- Recursive!
f :: A -> [A]
f = coerce
We have [W] A ~R# [A]. If we rewrite [A], it'll expand to
[[[[[...]]]]]
and blow the reduction stack. See Note [Newtypes can blow the stack]
in GHC.Tc.Solver.Rewrite. But if we expand only the /top level/ of
both sides, we get
[W] [A] ~R# [A]
which we can, just, solve by reflexivity.
So we simply unwrap, on-demand, at top level, in `can_eq_newtype_nc`.
This is all very delicate. There is a real risk of a loop in the type checker
with recursive newtypes -- but I think we're doomed to do *something*
delicate, as we're really trying to solve for equirecursive type
equality. Bottom line for users: recursive newtypes do not play well with type
inference for representational equality. See also Section 5.3.1 and 5.3.4 of
"Safe Zero-cost Coercions for Haskell" (JFP 2016).
Another approach -- which we ultimately decided against -- is described in
Note [Decomposing newtypes a bit more aggressively].
See also Note [Decomposing newtype equalities].
--- Historical side note ---
We flirted with doing /both/ unwrap-at-top-level /and/ rewrite-deeply;
see #22519. But that didn't work: see discussion in #22924. Specifically
we got a loop with a minor variation:
f2 :: a -> [A]
f2 = coerce
Note [Eager reflexivity check]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -1492,6 +1466,24 @@ we do a reflexivity check.
(This would be sound in the nominal case, but unnecessary, and I [Richard
E.] am worried that it would slow down the common case.)
Note [Newtypes can blow the stack]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose we have
newtype X = MkX (Int -> X)
newtype Y = MkY (Int -> Y)
and now wish to prove
[W] X ~R Y
This Wanted will loop, expanding out the newtypes ever deeper looking
for a solid match or a solid discrepancy. Indeed, there is something
appropriate to this looping, because X and Y *do* have the same representation,
in the limit -- they're both (Fix ((->) Int)). However, no finitely-sized
coercion will ever witness it. This loop won't actually cause GHC to hang,
though, because we check our depth in `can_eq_newtype_nc`.
-}
------------------------
......@@ -1598,8 +1590,7 @@ canEqCast rewritten ev eq_rel swapped ty1 co1 ty2 ps_ty2
role = eqRelRole eq_rel
------------------------
canTyConApp :: Bool -- True <=> the types have been rewritten
-> CtEvidence -> EqRel
canTyConApp :: CtEvidence -> EqRel
-> TyCon -> [TcType]
-> TyCon -> [TcType]
-> TcS (StopOrContinue Ct)
......@@ -1607,17 +1598,13 @@ canTyConApp :: Bool -- True <=> the types have been rewritten
-- See Note [Decomposing Dependent TyCons and Processing Wanted Equalities]
-- Neither tc1 nor tc2 is a saturated funTyCon, nor a type family
-- But they can be data families.
canTyConApp rewritten ev eq_rel tc1 tys1 tc2 tys2
canTyConApp ev eq_rel tc1 tys1 tc2 tys2
| tc1 == tc2
, tys1 `equalLength` tys2
= do { inerts <- getTcSInerts
; if can_decompose inerts
then canDecomposableTyConAppOK ev eq_rel tc1 tys1 tys2
else if rewritten
then canEqFailure ev eq_rel ty1 ty2
else rewrite_and_try_again ev eq_rel ty1 ty2 }
-- Why rewrite and try again? See Case 1
-- of Note [Unwrap newtypes first]
else canEqFailure ev eq_rel ty1 ty2 }
-- See Note [Skolem abstract data] in GHC.Core.Tycon
| tyConSkolem tc1 || tyConSkolem tc2
......@@ -1641,7 +1628,7 @@ canTyConApp rewritten ev eq_rel tc1 tys1 tc2 tys2
ty2 = mkTyConApp tc2 tys2
-- See Note [Decomposing TyConApp equalities]
-- Note [Decomposing newtypes a bit more aggressively]
-- and Note [Decomposing newtype equalities]
can_decompose inerts
= isInjectiveTyCon tc1 (eqRelRole eq_rel)
|| (assert (eq_rel == ReprEq) $
......@@ -1650,7 +1637,8 @@ canTyConApp rewritten ev eq_rel tc1 tys1 tc2 tys2
-- Moreover isInjectiveTyCon is True for Representational
-- for algebraic data types. So we are down to newtypes
-- and data families.
ctEvFlavour ev == Wanted && noGivenIrreds inerts)
ctEvFlavour ev == Wanted && noGivenNewtypeReprEqs tc1 inerts)
-- See Note [Decomposing newtype equalities] (EX2)
{-
Note [Use canEqFailure in canDecomposableTyConApp]
......@@ -1838,13 +1826,13 @@ Example is wrinkle {1} in Note [Decomposing TyConApp equalities].
For a Wanted with r=R, since newtypes are not injective at representational
role, decomposition is sound, but we may lose completeness. Nevertheless,
if the newtype is abstraction (so can't be unwrapped) we can only solve
if the newtype is abstract (so can't be unwrapped) we can only solve
the equality by (a) using a Given or (b) decomposition. If (a) is impossible
(e.g. no Givens) then (b) is safe.
(e.g. no Givens) then (b) is safe albeit potentially incomplete.
Conclusion: decompose newtypes (at role R) only if there are no usable Givens.
There are two ways in which decomposing (N ty1) ~r (N ty2) could be incomplete:
* Incompleteness example (EX1)
* Incompleteness example (EX1): unwrap first
newtype Nt a = MkNt (Id a)
type family Id a where Id a = a
......@@ -1856,39 +1844,68 @@ Conclusion: decompose newtypes (at role R) only if there are no usable Givens.
Conclusion: always unwrap newtypes before attempting to decompose
them. This is done in can_eq_nc'. Of course, we can't unwrap if the data
constructor isn't in scope. See See Note [Unwrap newtypes first].
constructor isn't in scope. See Note [Unwrap newtypes first].
* Incompleteness example (EX2)
* Incompleteness example (EX2): available Givens
newtype Nt a = Mk Bool -- NB: a is not used in the RHS,
type role Nt representational -- but the user gives it an R role anyway
If we have [W] Nt alpha ~R Nt beta, we *don't* want to decompose to
[W] alpha ~R beta, because it's possible that alpha and beta aren't
representationally equal.
[G] Nt t1 ~R Nt t2
[W] Nt alpha ~R Nt beta
and maybe there is a Given (Nt t1 ~R Nt t2), just waiting to be used, if we
figure out (elsewhere) that alpha:=t1 and beta:=t2. This is somewhat
similar to the question of overlapping Givens for class constraints: see
Note [Instance and Given overlap] in GHC.Tc.Solver.Interact.
We *don't* want to decompose to [W] alpha ~R beta, because it's possible
that alpha and beta aren't representationally equal. And if we figure
out (elsewhere) that alpha:=t1 and beta:=t2, we can solve the Wanted
from the Given. This is somewhat similar to the question of overlapping
Givens for class constraints: see Note [Instance and Given overlap] in
GHC.Tc.Solver.Interact.
Conclusion: don't decompose [W] N s ~R N t, if there are any Given
equalities that could later solve it.
But what does "any Given equalities that could later solve it" mean, precisely?
It must be a Given constraint that could turn into N s ~ N t. But that
could include [G] (a b) ~ (c d), or even just [G] c. But it'll definitely
be an CIrredCan. So we settle for having no CIrredCans at all, which is
conservative but safe. See noGivenIrreds and #22331.
But what precisely does it mean to say "any Given equalities that could
later solve it"?
In #22924 we had
[G] f a ~R# a [W] Const (f a) a ~R# Const a a
where Const is an abstract newtype. If we decomposed the newtype, we
could solve. Not-decomposing on the grounds that (f a ~R# a) might turn
into (Const (f a) a ~R# Const a a) seems a bit silly.
In #22331 we had
[G] N a ~R# N b [W] N b ~R# N a
(where N is abstract so we can't unwrap). Here we really /don't/ want to
decompose, because the /only/ way to solve the Wanted is from that Given
(with a Sym).
In #22519 we had
[G] a <= b [W] IO Age ~R# IO Int
(where IO is abstract so we can't unwrap, and newtype Age = Int; and (<=)
is a type-level comparison on Nats). Here we /must/ decompose, despite the
existence of an Irred Given, or we will simply be stuck. (Side note: We
flirted with deep-rewriting of newtypes (see discussion on #22519 and
!9623) but that turned out not to solve #22924, and also makes type
inference loop more often on recursive newtypes.)
The currently-implemented compromise is this:
we decompose [W] N s ~R# N t unless there is a [G] N s' ~ N t'
that is, a Given Irred equality with both sides headed with N.
See the call to noGivenNewtypeReprEqs in canTyConApp.
This is not perfect. In principle a Given like [G] (a b) ~ (c d), or
even just [G] c, could later turn into N s ~ N t. But since the free
vars of a Given are skolems, or at least untouchable unification
variables, this is extremely unlikely to happen.
Well not 100.0% safe. There could be a CDictCan with some un-expanded
superclasses; but only in some very obscure recursive-superclass
situations.
Another worry: there could, just, be a CDictCan with some
un-expanded equality superclasses; but only in some very obscure
recursive-superclass situations.
If there are no Irred Givens (which is quite common) then we will
successfuly decompose [W] (IO Age) ~R (IO Int), and solve it. But
that won't happen and [W] (IO Age) ~R (IO Int) will be stuck.
We /could/, however, be a bit more aggressive about decomposition;
see Note [Decomposing newtypes a bit more aggressively].
Yet another approach (!) is desribed in
Note [Decomposing newtypes a bit more aggressively].
Remember: decomposing Wanteds is always /sound/. This Note is
only about /completeness/.
......@@ -1896,7 +1913,8 @@ only about /completeness/.
Note [Decomposing newtypes a bit more aggressively]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IMPORTANT: the ideas in this Note are *not* implemented. Instead, the
current approach is detailed in Note [Unwrap newtypes first].
current approach is detailed in Note [Decomposing newtype equalities]
and Note [Unwrap newtypes first].
For more details about the ideas in this Note see
* GHC propoosal: https://github.com/ghc-proposals/ghc-proposals/pull/549
* issue #22441
......
......@@ -21,7 +21,7 @@ module GHC.Tc.Solver.InertSet (
addInertItem,
noMatchableGivenDicts,
noGivenIrreds,
noGivenNewtypeReprEqs,
mightEqualLater,
prohibitedSuperClassSolve,
......@@ -1537,9 +1537,22 @@ isOuterTyVar tclvl tv
-- becomes "outer" even though its level numbers says it isn't.
| otherwise = False -- Coercion variables; doesn't much matter
noGivenIrreds :: InertSet -> Bool
noGivenIrreds (IS { inert_cans = inert_cans })
= isEmptyBag (inert_irreds inert_cans)
noGivenNewtypeReprEqs :: TyCon -> InertSet -> Bool
-- True <=> there is no Irred looking like (N tys1 ~ N tys2)
-- See Note [Decomposing newtype equalities] (EX2) in GHC.Tc.Solver.Canonical
-- This is the only call site.
noGivenNewtypeReprEqs tc inerts
= not (anyBag might_help (inert_irreds (inert_cans inerts)))
where
might_help ct
= case classifyPredType (ctPred ct) of
EqPred ReprEq t1 t2
| Just (tc1,_) <- tcSplitTyConApp_maybe t1
, tc == tc1
, Just (tc2,_) <- tcSplitTyConApp_maybe t2
, tc == tc2
-> True
_ -> False
-- | Returns True iff there are no Given constraints that might,
-- potentially, match the given class consraint. This is used when checking to see if a
......
......@@ -42,7 +42,6 @@ import GHC.Builtin.Types (tYPETyCon)
import Data.List ( find )
import GHC.Data.List.Infinite (Infinite)
import qualified GHC.Data.List.Infinite as Inf
import GHC.Tc.Instance.Family (tcTopNormaliseNewTypeTF_maybe)
{-
************************************************************************
......@@ -225,10 +224,10 @@ rewrite ev ty
; return result }
-- | See Note [Rewriting]
-- This variant of 'rewrite' rewrites w.r.t. nominal equality only,
-- as this is better than full rewriting for error messages. Specifically,
-- we want to avoid unwrapping newtypes, as doing so can end up causing
-- an otherwise-unnecessary stack overflow.
-- `rewriteForErrors` is a variant of 'rewrite' that rewrites
-- w.r.t. nominal equality only, as this is better than full rewriting
-- for error messages. (This was important when we flirted with rewriting
-- newtypes but perhaps less so now.)
rewriteForErrors :: CtEvidence -> TcType
-> TcS (Reduction, RewriterSet)
rewriteForErrors ev ty
......@@ -499,27 +498,14 @@ rewrite_one (TyVarTy tv)
rewrite_one (AppTy ty1 ty2)
= rewrite_app_tys ty1 [ty2]
rewrite_one ty@(TyConApp tc tys)
rewrite_one (TyConApp tc tys)
-- If it's a type family application, try to reduce it
| isTypeFamilyTyCon tc
= rewrite_fam_app tc tys
| otherwise
= do { eq_rel <- getEqRel
; if eq_rel == ReprEq
then -- Rewriting w.r.t. representational equality requires
-- unwrapping newtypes; see GHC.Tc.Solver.Canonical.
-- Note [Unwrap newtypes first]
-- NB: try rewrite_newtype_app even when tc isn't a newtype;
-- the allows the possibility of having a newtype buried under
-- a synonym. Needed for e.g. T12067.
rewrite_newtype_app ty
else -- For * a normal data type application
-- * data family application
-- we just recursively rewrite the arguments.
rewrite_ty_con_app tc tys }
| otherwise -- We just recursively rewrite the arguments.
-- See Note [Do not rewrite newtypes]
= rewrite_ty_con_app tc tys
rewrite_one (FunTy { ft_af = vis, ft_mult = mult, ft_arg = ty1, ft_res = ty2 })
= do { arg_redn <- rewrite_one ty1
......@@ -678,42 +664,12 @@ rewrite_vector ki roles tys
fvs = tyCoVarsOfType ki
{-# INLINE rewrite_vector #-}
-- Rewrite a (potential) newtype application
-- Precondition: the ambient EqRel is ReprEq
-- Precondition: the type is a TyConApp
-- See Note [Newtypes can blow the stack]
rewrite_newtype_app :: TcType -> RewriteM Reduction
rewrite_newtype_app ty@(TyConApp tc tys)
= do { rdr_env <- liftTcS getGlobalRdrEnvTcS
; tf_envs <- liftTcS getFamInstEnvs
; case (tcTopNormaliseNewTypeTF_maybe tf_envs rdr_env ty) of
Nothing -> -- Non-newtype or abstract newtype
rewrite_ty_con_app tc tys
Just ((used_ctors, co), ty') -- co :: ty ~ ty'
-> do { liftTcS $ recordUsedGREs used_ctors
; checkStackDepth ty
; rewrite_reduction (Reduction co ty') } }
rewrite_newtype_app other_ty = pprPanic "rewrite_newtype_app" (ppr other_ty)
{- Note [Newtypes can blow the stack]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose we have
newtype X = MkX (Int -> X)
newtype Y = MkY (Int -> Y)
and now wish to prove
[W] X ~R Y
This Wanted will loop, expanding out the newtypes ever deeper looking
for a solid match or a solid discrepancy. Indeed, there is something
appropriate to this looping, because X and Y *do* have the same representation,
in the limit -- they're both (Fix ((->) Int)). However, no finitely-sized
coercion will ever witness it. This loop won't actually cause GHC to hang,
though, because we check our depth when unwrapping newtypes.
{- Note [Do not rewrite newtypes]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We flirted with unwrapping newtypes in the rewriter -- see GHC.Tc.Solver.Canonical
Note [Unwrap newtypes first]. But that turned out to be a bad idea because
of recursive newtypes, as that Note says. So be careful if you re-add it!
Note [Rewriting synonyms]
~~~~~~~~~~~~~~~~~~~~~~~~~~
......
Subproject commit ceff1dcd7893f7ab4abb6e66bcd248abd86c8886
Subproject commit ef4fa181ebea77ac6997d392d1ef5a09524f06b2
......@@ -26,7 +26,9 @@ from pathlib import Path
# So we import it here first, so that the testsuite doesn't appear to fail.
import subprocess
from testutil import getStdout, Watcher, str_warn, str_info, print_table, shorten_metric_name
from concurrent.futures import ThreadPoolExecutor
from testutil import getStdout, str_warn, str_info, print_table, shorten_metric_name
from testglobals import getConfig, ghc_env, getTestRun, TestConfig, \
TestOptions, brokens, PerfMetric
from my_typing import TestName
......@@ -151,7 +153,6 @@ config.broken_tests |= {TestName(t) for t in args.broken_test}
if args.threads:
config.threads = args.threads
config.use_threads = True
if args.verbose is not None:
config.verbose = args.verbose
......@@ -481,26 +482,28 @@ if config.list_broken:
print('WARNING:', len(t.framework_failures), 'framework failures!')
print('')
else:
# completion watcher
watcher = Watcher(len(parallelTests))
# Now run all the tests
try:
for oneTest in parallelTests:
if stopping():
break
oneTest(watcher)
with ThreadPoolExecutor(max_workers=config.threads) as executor:
for oneTest in parallelTests:
if stopping():
break
oneTest(executor)
# wait for parallel tests to finish
if not stopping():
watcher.wait()
# wait for parallel tests to finish
if not stopping():
executor.shutdown(wait=True)
# Run the following tests purely sequential
config.use_threads = False
for oneTest in aloneTests:
if stopping():
break
oneTest(watcher)
with ThreadPoolExecutor(max_workers=1) as executor:
for oneTest in aloneTests:
if stopping():
break
oneTest(executor)
if not stopping():
executor.shutdown(wait=True)
except KeyboardInterrupt:
pass
......
......@@ -177,7 +177,6 @@ class TestConfig:
# threads
self.threads = 1
self.use_threads = False
# tests which should be considered to be broken during this testsuite
# run.
......
......@@ -36,10 +36,7 @@ from my_typing import *
from threading import Timer
from collections import OrderedDict
global pool_sema
if config.use_threads:
import threading
pool_sema = threading.BoundedSemaphore(value=config.threads)
import threading
global wantToStop
wantToStop = False
......@@ -84,12 +81,7 @@ def get_all_ways() -> Set[WayName]:
# testdir_testopts after each test).
global testopts_local
if config.use_threads:
testopts_local = threading.local()
else:
class TestOpts_Local:
pass
testopts_local = TestOpts_Local() # type: ignore
testopts_local = threading.local()
def getTestOpts() -> TestOptions:
return testopts_local.x
......@@ -1020,16 +1012,8 @@ parallelTests = []
aloneTests = []
allTestNames = set([]) # type: Set[TestName]
def runTest(watcher, opts, name: TestName, func, args):
if config.use_threads:
pool_sema.acquire()
t = threading.Thread(target=test_common_thread,
name=name,
args=(watcher, name, opts, func, args))
t.daemon = False
t.start()
else:
test_common_work(watcher, name, opts, func, args)
def runTest(executor, opts, name: TestName, func, args):
return executor.submit(test_common_work, name, opts, func, args)
# name :: String
# setup :: [TestOpt] -> IO ()
......@@ -1067,20 +1051,13 @@ def test(name: TestName,
if name in config.broken_tests:
myTestOpts.expect = 'fail'
thisTest = lambda watcher: runTest(watcher, myTestOpts, name, func, args)
thisTest = lambda executor: runTest(executor, myTestOpts, name, func, args)
if myTestOpts.alone:
aloneTests.append(thisTest)
else:
parallelTests.append(thisTest)
allTestNames.add(name)
if config.use_threads:
def test_common_thread(watcher, name, opts, func, args):
try:
test_common_work(watcher, name, opts, func, args)
finally:
pool_sema.release()
def get_package_cache_timestamp() -> float:
if config.package_conf_cache_file is None:
return 0.0
......@@ -1094,8 +1071,7 @@ do_not_copy = ('.hi', '.o', '.dyn_hi'
, '.dyn_o', '.out'
,'.hi-boot', '.o-boot') # 12112
def test_common_work(watcher: testutil.Watcher,
name: TestName, opts,
def test_common_work(name: TestName, opts,
func, args) -> None:
try:
t.total_tests += 1
......@@ -1214,8 +1190,6 @@ def test_common_work(watcher: testutil.Watcher,
except Exception as e:
framework_fail(name, None, 'Unhandled exception: ' + str(e))
finally:
watcher.notify()
def do_test(name: TestName,
way: WayName,
......
......@@ -5,8 +5,6 @@ import tempfile
from pathlib import Path, PurePath
from term_color import Color, colored
import threading
from my_typing import *
......@@ -125,24 +123,6 @@ else:
else:
os.symlink(str(src), str(dst))
class Watcher(object):
def __init__(self, count: int) -> None:
self.pool = count
self.evt = threading.Event()
self.sync_lock = threading.Lock()
if count <= 0:
self.evt.set()
def wait(self):
self.evt.wait()
def notify(self):
self.sync_lock.acquire()
self.pool -= 1
if self.pool <= 0:
self.evt.set()
self.sync_lock.release()
def memoize(f):
"""
A decorator to memoize a nullary function.
......
test('T1959', [extra_files(['B.hs', 'C.hs', 'D.hs', 'E1.hs', 'E2.hs']), js_broken(22261)], makefile_test, ['dotest'])
test('T1959', [extra_files(['B.hs', 'C.hs', 'D.hs', 'E1.hs', 'E2.hs']), js_broken(22374)], makefile_test, ['dotest'])
......@@ -167,10 +167,10 @@ test('T5594', [ omit_ways(['ghci']),
],
compile_and_run, ['T5594_c.c -no-hs-main'])
test('Capi_Ctype_001', [extra_files(['Capi_Ctype_A_001.hsc', 'capi_ctype_001.h', 'capi_ctype_001_c.c']), js_broken(22374)],
test('Capi_Ctype_001', [extra_files(['Capi_Ctype_A_001.hsc', 'capi_ctype_001.h', 'capi_ctype_001_c.c']), req_c],
makefile_test, ['Capi_Ctype_001'])
test('Capi_Ctype_002', [extra_files(['Capi_Ctype_A_002.hsc', 'capi_ctype_002_A.h', 'capi_ctype_002_B.h']), js_broken(22374)],
test('Capi_Ctype_002', [extra_files(['Capi_Ctype_A_002.hsc', 'capi_ctype_002_A.h', 'capi_ctype_002_B.h']), req_c],
makefile_test, ['Capi_Ctype_002'])
test('ffi_parsing_001', [omit_ways(['ghci']), req_c], compile_and_run,
......
module T22919 {- comment -} where
foo = 's'
==================== Parser AST ====================
(L
{ T22919.hs:1:1 }
(HsModule
(XModulePs
(EpAnn
(Anchor
{ T22919.hs:1:1 }
(UnchangedAnchor))
(AnnsModule
[(AddEpAnn AnnModule (EpaSpan { T22919.hs:1:1-6 }))
,(AddEpAnn AnnWhere (EpaSpan { T22919.hs:1:29-33 }))]
(AnnList
(Nothing)
(Nothing)
(Nothing)
[]
[])
(Just
((,)
{ T22919.hs:3:1 }
{ T22919.hs:2:7-9 })))
(EpaCommentsBalanced
[(L
(Anchor
{ T22919.hs:1:15-27 }
(UnchangedAnchor))
(EpaComment
(EpaBlockComment
"{- comment -}")
{ T22919.hs:1:8-13 }))]
[]))
(VirtualBraces
(1))
(Nothing)
(Nothing))
(Just
(L
(SrcSpanAnn (EpAnnNotUsed) { T22919.hs:1:8-13 })
{ModuleName: T22919}))
(Nothing)
[]
[(L
(SrcSpanAnn (EpAnn
(Anchor
{ T22919.hs:2:1-9 }
(UnchangedAnchor))
(AnnListItem
[])
(EpaComments
[])) { T22919.hs:2:1-9 })
(ValD
(NoExtField)
(FunBind
(NoExtField)
(L
(SrcSpanAnn (EpAnnNotUsed) { T22919.hs:2:1-3 })
(Unqual
{OccName: foo}))
(MG
(FromSource)
(L
(SrcSpanAnn (EpAnnNotUsed) { T22919.hs:2:1-9 })
[(L
(SrcSpanAnn (EpAnnNotUsed) { T22919.hs:2:1-9 })
(Match
(EpAnn
(Anchor
{ T22919.hs:2:1-9 }
(UnchangedAnchor))
[]
(EpaComments
[]))
(FunRhs
(L
(SrcSpanAnn (EpAnnNotUsed) { T22919.hs:2:1-3 })
(Unqual
{OccName: foo}))
(Prefix)
(NoSrcStrict))
[]
(GRHSs
(EpaComments
[])
[(L
(SrcSpanAnn
(EpAnnNotUsed)
{ T22919.hs:2:5-9 })
(GRHS
(EpAnn
(Anchor
{ T22919.hs:2:5-9 }
(UnchangedAnchor))
(GrhsAnn
(Nothing)
(AddEpAnn AnnEqual (EpaSpan { T22919.hs:2:5 })))
(EpaComments
[]))
[]
(L
(SrcSpanAnn (EpAnnNotUsed) { T22919.hs:2:7-9 })
(HsLit
(EpAnn
(Anchor
{ T22919.hs:2:7-9 }
(UnchangedAnchor))
(NoEpAnns)
(EpaComments
[]))
(HsChar
(SourceText 's')
('s'))))))]
(EmptyLocalBinds
(NoExtField)))))])))))]))
......@@ -23,7 +23,14 @@
{ Test20239.hs:8:1 }
{ Test20239.hs:7:34-63 })))
(EpaCommentsBalanced
[]
[(L
(Anchor
{ Test20239.hs:3:1-28 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- | Leading Haddock Comment")
{ Test20239.hs:1:18-22 }))]
[(L
(Anchor
{ Test20239.hs:7:34-63 }
......@@ -50,14 +57,7 @@
(AnnListItem
[])
(EpaComments
[(L
(Anchor
{ Test20239.hs:3:1-28 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- | Leading Haddock Comment")
{ Test20239.hs:1:18-22 }))])) { Test20239.hs:(4,1)-(6,86) })
[])) { Test20239.hs:(4,1)-(6,86) })
(InstD
(NoExtField)
(DataFamInstD
......@@ -323,5 +323,5 @@
Test20239.hs:4:15: error: [GHC-76037]
Test20239.hs:4:15: [GHC-76037]
Not in scope: type constructor or class ‘Method’
......@@ -30,7 +30,15 @@
(EpaComment
(EpaLineComment
"-- leading comments")
{ ZeroWidthSemi.hs:1:22-26 }))]
{ ZeroWidthSemi.hs:1:22-26 }))
,(L
(Anchor
{ ZeroWidthSemi.hs:5:1-19 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- Function comment")
{ ZeroWidthSemi.hs:3:1-19 }))]
[(L
(Anchor
{ ZeroWidthSemi.hs:8:1-58 }
......@@ -57,14 +65,7 @@
(AnnListItem
[])
(EpaComments
[(L
(Anchor
{ ZeroWidthSemi.hs:5:1-19 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- Function comment")
{ ZeroWidthSemi.hs:3:1-19 }))])) { ZeroWidthSemi.hs:6:1-5 })
[])) { ZeroWidthSemi.hs:6:1-5 })
(ValD
(NoExtField)
(FunBind
......
......@@ -38,3 +38,4 @@ test('AddHiding1', ignore_stderr, makefile_test, ['AddHiding1'])
test('AddHiding2', ignore_stderr, makefile_test, ['AddHiding2'])
test('Test20239', normal, compile_fail, ['-dsuppress-uniques -ddump-parsed-ast -dkeep-comments'])
test('ZeroWidthSemi', normal, compile, ['-dsuppress-uniques -ddump-parsed-ast -dkeep-comments'])
test('T22919', normal, compile, ['-dsuppress-uniques -ddump-parsed-ast -dkeep-comments'])
......@@ -4,6 +4,9 @@
-}
module DumpParsedAstComments where
-- comment 1 for bar
-- comment 2 for bar
bar = 1
-- Other comment
-- comment 1 for foo
......
......@@ -21,8 +21,8 @@
[])
(Just
((,)
{ DumpParsedAstComments.hs:17:1 }
{ DumpParsedAstComments.hs:16:17-23 })))
{ DumpParsedAstComments.hs:20:1 }
{ DumpParsedAstComments.hs:19:17-23 })))
(EpaCommentsBalanced
[(L
(Anchor
......@@ -42,12 +42,20 @@
{ DumpParsedAstComments.hs:1:1-28 }))
,(L
(Anchor
{ DumpParsedAstComments.hs:7:1-16 }
{ DumpParsedAstComments.hs:7:1-20 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- Other comment")
{ DumpParsedAstComments.hs:5:30-34 }))]
"-- comment 1 for bar")
{ DumpParsedAstComments.hs:5:30-34 }))
,(L
(Anchor
{ DumpParsedAstComments.hs:8:1-20 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- comment 2 for bar")
{ DumpParsedAstComments.hs:7:1-20 }))]
[]))
(VirtualBraces
(1))
......@@ -62,55 +70,139 @@
[(L
(SrcSpanAnn (EpAnn
(Anchor
{ DumpParsedAstComments.hs:(11,1)-(13,3) }
{ DumpParsedAstComments.hs:9:1-7 }
(UnchangedAnchor))
(AnnListItem
[])
(EpaComments
[])) { DumpParsedAstComments.hs:9:1-7 })
(ValD
(NoExtField)
(FunBind
(NoExtField)
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:9:1-3 })
(Unqual
{OccName: bar}))
(MG
(FromSource)
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:9:1-7 })
[(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:9:1-7 })
(Match
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:9:1-7 }
(UnchangedAnchor))
[]
(EpaComments
[]))
(FunRhs
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:9:1-3 })
(Unqual
{OccName: bar}))
(Prefix)
(NoSrcStrict))
[]
(GRHSs
(EpaComments
[])
[(L
(SrcSpanAnn
(EpAnnNotUsed)
{ DumpParsedAstComments.hs:9:5-7 })
(GRHS
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:9:5-7 }
(UnchangedAnchor))
(GrhsAnn
(Nothing)
(AddEpAnn AnnEqual (EpaSpan { DumpParsedAstComments.hs:9:5 })))
(EpaComments
[]))
[]
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:9:7 })
(HsOverLit
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:9:7 }
(UnchangedAnchor))
(NoEpAnns)
(EpaComments
[]))
(OverLit
(NoExtField)
(HsIntegral
(IL
(SourceText 1)
(False)
(1))))))))]
(EmptyLocalBinds
(NoExtField)))))])))))
,(L
(SrcSpanAnn (EpAnn
(Anchor
{ DumpParsedAstComments.hs:(14,1)-(16,3) }
(UnchangedAnchor))
(AnnListItem
[])
(EpaComments
[(L
(Anchor
{ DumpParsedAstComments.hs:9:1-20 }
{ DumpParsedAstComments.hs:10:1-16 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- Other comment")
{ DumpParsedAstComments.hs:9:7 }))
,(L
(Anchor
{ DumpParsedAstComments.hs:12:1-20 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- comment 1 for foo")
{ DumpParsedAstComments.hs:7:1-16 }))
{ DumpParsedAstComments.hs:10:1-16 }))
,(L
(Anchor
{ DumpParsedAstComments.hs:10:1-20 }
{ DumpParsedAstComments.hs:13:1-20 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- comment 2 for foo")
{ DumpParsedAstComments.hs:9:1-20
}))])) { DumpParsedAstComments.hs:(11,1)-(13,3) })
{ DumpParsedAstComments.hs:12:1-20
}))])) { DumpParsedAstComments.hs:(14,1)-(16,3) })
(ValD
(NoExtField)
(FunBind
(NoExtField)
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:11:1-3 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:14:1-3 })
(Unqual
{OccName: foo}))
(MG
(FromSource)
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:(11,1)-(13,3)
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:(14,1)-(16,3)
})
[(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:(11,1)-(13,3)
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:(14,1)-(16,3)
})
(Match
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:(11,1)-(13,3) }
{ DumpParsedAstComments.hs:(14,1)-(16,3) }
(UnchangedAnchor))
[]
(EpaComments
[]))
(FunRhs
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:11:1-3 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:14:1-3 })
(Unqual
{OccName: foo}))
(Prefix)
......@@ -122,72 +214,72 @@
[(L
(SrcSpanAnn
(EpAnnNotUsed)
{ DumpParsedAstComments.hs:(11,5)-(13,3) })
{ DumpParsedAstComments.hs:(14,5)-(16,3) })
(GRHS
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:(11,5)-(13,3) }
{ DumpParsedAstComments.hs:(14,5)-(16,3) }
(UnchangedAnchor))
(GrhsAnn
(Nothing)
(AddEpAnn AnnEqual (EpaSpan { DumpParsedAstComments.hs:11:5 })))
(AddEpAnn AnnEqual (EpaSpan { DumpParsedAstComments.hs:14:5 })))
(EpaComments
[]))
[]
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:(11,7)-(13,3)
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:(14,7)-(16,3)
})
(HsDo
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:(11,7)-(13,3) }
{ DumpParsedAstComments.hs:(14,7)-(16,3) }
(UnchangedAnchor))
(AnnList
(Just
(Anchor
{ DumpParsedAstComments.hs:13:3 }
{ DumpParsedAstComments.hs:16:3 }
(UnchangedAnchor)))
(Nothing)
(Nothing)
[(AddEpAnn AnnDo (EpaSpan { DumpParsedAstComments.hs:11:7-8 }))]
[(AddEpAnn AnnDo (EpaSpan { DumpParsedAstComments.hs:14:7-8 }))]
[])
(EpaComments
[(L
(Anchor
{ DumpParsedAstComments.hs:12:3-19 }
{ DumpParsedAstComments.hs:15:3-19 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- normal comment")
{ DumpParsedAstComments.hs:11:7-8 }))]))
{ DumpParsedAstComments.hs:14:7-8 }))]))
(DoExpr
(Nothing))
(L
(SrcSpanAnn (EpAnn
(Anchor
{ DumpParsedAstComments.hs:13:3 }
{ DumpParsedAstComments.hs:16:3 }
(UnchangedAnchor))
(AnnList
(Just
(Anchor
{ DumpParsedAstComments.hs:13:3 }
{ DumpParsedAstComments.hs:16:3 }
(UnchangedAnchor)))
(Nothing)
(Nothing)
[]
[])
(EpaComments
[])) { DumpParsedAstComments.hs:13:3 })
[])) { DumpParsedAstComments.hs:16:3 })
[(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:13:3 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:3 })
(BodyStmt
(NoExtField)
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:13:3 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:3 })
(HsOverLit
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:13:3 }
{ DumpParsedAstComments.hs:16:3 }
(UnchangedAnchor))
(NoEpAnns)
(EpaComments
......@@ -206,45 +298,45 @@
,(L
(SrcSpanAnn (EpAnn
(Anchor
{ DumpParsedAstComments.hs:16:1-23 }
{ DumpParsedAstComments.hs:19:1-23 }
(UnchangedAnchor))
(AnnListItem
[])
(EpaComments
[(L
(Anchor
{ DumpParsedAstComments.hs:15:1-20 }
{ DumpParsedAstComments.hs:18:1-20 }
(UnchangedAnchor))
(EpaComment
(EpaLineComment
"-- | Haddock comment")
{ DumpParsedAstComments.hs:13:3
}))])) { DumpParsedAstComments.hs:16:1-23 })
{ DumpParsedAstComments.hs:16:3
}))])) { DumpParsedAstComments.hs:19:1-23 })
(ValD
(NoExtField)
(FunBind
(NoExtField)
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:1-4 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:19:1-4 })
(Unqual
{OccName: main}))
(MG
(FromSource)
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:1-23 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:19:1-23 })
[(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:1-23 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:19:1-23 })
(Match
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:16:1-23 }
{ DumpParsedAstComments.hs:19:1-23 }
(UnchangedAnchor))
[]
(EpaComments
[]))
(FunRhs
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:1-4 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:19:1-4 })
(Unqual
{OccName: main}))
(Prefix)
......@@ -256,42 +348,42 @@
[(L
(SrcSpanAnn
(EpAnnNotUsed)
{ DumpParsedAstComments.hs:16:6-23 })
{ DumpParsedAstComments.hs:19:6-23 })
(GRHS
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:16:6-23 }
{ DumpParsedAstComments.hs:19:6-23 }
(UnchangedAnchor))
(GrhsAnn
(Nothing)
(AddEpAnn AnnEqual (EpaSpan { DumpParsedAstComments.hs:16:6 })))
(AddEpAnn AnnEqual (EpaSpan { DumpParsedAstComments.hs:19:6 })))
(EpaComments
[]))
[]
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:8-23 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:19:8-23 })
(HsApp
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:16:8-23 }
{ DumpParsedAstComments.hs:19:8-23 }
(UnchangedAnchor))
(NoEpAnns)
(EpaComments
[]))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:8-15 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:19:8-15 })
(HsVar
(NoExtField)
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:8-15 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:19:8-15 })
(Unqual
{OccName: putStrLn}))))
(L
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:16:17-23 })
(SrcSpanAnn (EpAnnNotUsed) { DumpParsedAstComments.hs:19:17-23 })
(HsLit
(EpAnn
(Anchor
{ DumpParsedAstComments.hs:16:17-23 }
{ DumpParsedAstComments.hs:19:17-23 }
(UnchangedAnchor))
(NoEpAnns)
(EpaComments
......
......@@ -258,7 +258,7 @@ test('T6006', [ omit_ways(prof_ways + ['ghci']),
# needs it.
compile_and_run, ['T6006_c.c -no-hs-main'])
test('T7037', js_broken(22374), makefile_test, ['T7037'])
test('T7037', req_c, makefile_test, ['T7037'])
test('T7087', exit_code(1), compile_and_run, [''])
test('T7160', [ omit_ways(['nonmoving_thr', 'nonmoving_thr_ghc'])
......