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
  • fangyi-zhou/ghc
  • augyg/ghc
640 results
Show changes
Commits on Source (36)
  • Alan Zimmerman's avatar
    TTG for IPBind had wrong extension name · 0c701b69
    Alan Zimmerman authored and Ben Gamari's avatar Ben Gamari committed
    The standard[1] for extension naming is to use the XC prefix for the
    internal extension points, rather than for a new constructor.
    
    This is violated for IPBind, having
    
        data IPBind id
          = IPBind
                (XIPBind id)
                (Either (Located HsIPName) (IdP id))
                (LHsExpr id)
          | XCIPBind (XXIPBind id)
    
    Swap the usage of XIPBind and XCIPBind
    
    [1] https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow#Namingconventions
    
    Closes #15302
    
    (cherry picked from commit 5f06cf6b)
    0c701b69
  • Vladislav Zavialov's avatar
    Do not imply NoStarIsType by TypeOperators/TypeInType · abd66223
    Vladislav Zavialov authored and Ben Gamari's avatar Ben Gamari committed
    Implementation of the "Embrace TypeInType" proposal was done according
    to the spec, which specified that TypeOperators must imply NoStarIsType.
    This implication was meant to prevent breakage and to be removed in 2
    releases.  However, compiling head.hackage has shown that this
    implication only magnified the breakage, so there is no reason to have
    it in the first place.
    
    To remain in compliance with the three-release policy, we add a
    workaround to define the (*) type operator even when -XStarIsType is on.
    
    Test Plan: ./validate
    
    Reviewers: bgamari, RyanGlScott, goldfire, phadej, hvr
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4865
    abd66223
  • Alan Zimmerman's avatar
    Tweak API Annotations for ConDeclGADT · 867e861b
    Alan Zimmerman authored and Ben Gamari's avatar Ben Gamari committed
    (cherry picked from commit 5db9f912)
    867e861b
  • Simon Peyton Jones's avatar
    Instances in no-evidence implications · 61adfbe6
    Simon Peyton Jones authored
    Trac #15290 showed that it's possible that we might attempt to use a
    quantified constraint to solve an equality in a situation where we
    don't have anywhere to put the evidence bindings.  This made GHC crash.
    
    This patch stops the crash, but still rejects the pogram.  See
    Note [Instances in no-evidence implications] in TcInteract.
    
    Finding this bug revealed another lurking bug:
    
    * An infelicity in the treatment of superclasses -- we were expanding
      them locally at the leaves, rather than at their binding site; see
      (3a) in Note [The superclass story].
    
      As a consequence, TcRnTypes.superclassesMightHelp must look inside
      implications.
    
    In more detail:
    
    * Stop the crash, by making TcInteract.chooseInstance test for
      the no-evidence-bindings case.  In that case we simply don't
      use the instance.  This entailed a slight change to the type
      of chooseInstance.
    
    * Make TcSMonad.getPendingScDicts (now renamed getPendingGivenScs)
      return only Givens from the /current level/; and make
      TcRnTypes.superClassesMightHelp look inside implications.
    
    * Refactor the simpl_loop and superclass-expansion stuff in
      TcSimplify.  The logic is much easier to understand now, and
      has less duplication.
    
    (cherry picked from commit 32eb4199)
    61adfbe6
  • Simon Peyton Jones's avatar
    Refactor the kind-checking of tyvar binders · 7e19610c
    Simon Peyton Jones authored
    The refactoring here is driven by the ghastly mess described in
    comment:24 of Trac #1520.  The overall goal is to simplify the
    kind-checking of typev-variable binders, and in particular to narrow
    the use of the "in-scope tyvar binder" stuff,
    which is needed only for associated types: see the new
    Note [Kind-checking tyvar binders for associated types] in TcHsType.
    
    Now
    
    * The "in-scope tyvar binder" stuff is done only in
         - kcLHsQTyVars, which is used for the LHsQTyVars of a
           data/newtype, or type family declaration.
    
         - tcFamTyPats, which is used for associated family instances;
           it now calls tcImplicitQTKBndrs, which in turn usese
           newFlexiKindedQTyVar
    
    * tcExpicitTKBndrs (which is used only for function signatures,
      data con signatures, pattern synonym signatures, and expression
      type signatures) now does not go via the "in-scope tyvar binder"
      stuff at all.
    
    While I'm still not happy with all this code, the code is generally
    simpler, and I think this is a useful step forward. It does cure
    the problem too.
    
    (It's hard to trigger the problem in vanilla Haskell code, because
    the renamer would normally use different names for nested binders,
    so I can't offer a test.)
    
    (cherry picked from commit 9fc40c73)
    7e19610c
  • Simon Peyton Jones's avatar
    Fix TcLevel manipulation in TcDerivInfer.simplifyDeriv · 145f7c66
    Simon Peyton Jones authored
    The level numbers we were getting simply didn't obey the
    invariant (ImplicInv) in TcType
       Note [TcLevel and untouchable type variables]
    
    That leads to chaos. Easy to fix.  I improved the documentation.
    
    I also added an assertion in TcSimplify that checks that
    level numbers go up by 1 as we dive inside implications, so
    that we catch the problem at source rather than than through
    its obscure consequences.
    
    That in turn showed up that TcRules was also generating
    constraints that didn't obey (ImplicInv), so I fixed that too.
    I have no idea what consequences were lurking behing that
    bug, but anyway now it's fixed.  Hooray.
    
    (cherry picked from commit 261dd83c)
    145f7c66
  • Alan Zimmerman's avatar
    API Annotations when parsing typapp · 4cfeca02
    Alan Zimmerman authored and Ben Gamari's avatar Ben Gamari committed
    Make sure the original annotations are still accessible for a promoted
    type.
    
    Closes #15303
    
    (cherry picked from commit e53c113d)
    4cfeca02
  • Simon Peyton Jones's avatar
    Fix error recovery for pattern synonyms · 149d7912
    Simon Peyton Jones authored
    As Trac #15289 showed, we were carrying on after a type error
    in a pattern synonym, and then crashing.  This patch improves
    error handling for pattern synonyms.
    
    I also moved a bit of code from TcBinds into TcPatSyn, which
    helpfully narrows the API.
    
    (cherry picked from commit 2896082e)
    149d7912
  • Ben Gamari's avatar
    Bump xhtml submodule to 3000.2.2.1 · 5059edb0
    Ben Gamari authored
    (cherry picked from commit 5a1290a8317056065f409ffd47fa6114172a1a15)
    5059edb0
  • Sylvain Henry's avatar
    Fix for built-in Natural literals desugaring · 31f7d21b
    Sylvain Henry authored
    The recent patch "Built-in Natural literals in Core"
    (https://phabricator.haskell.org/rGHCfe770c211631e7b4c9b0b1e88ef9b6046c6
    585ef) introduced a regression when desugaring large numbers.
    
    This patch fixes it and adds a regression test.
    
    Reviewers: hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15301
    
    Differential Revision: https://phabricator.haskell.org/D4885
    
    (cherry picked from commit 987b5e7f)
    31f7d21b
  • Richard Eisenberg's avatar
    Expand and implement Note [The tcType invariant] · 634c07dc
    Richard Eisenberg authored and Ben Gamari's avatar Ben Gamari committed
    Read that note -- it's necessary to make sure that we can
    always call typeKind without panicking. As discussed on #14873,
    there were more checks and zonking to do, implemented here.
    There are no known bugs fixed by this patch, but there are likely
    unknown ones.
    
    (cherry picked from commit cf67e59a)
    634c07dc
  • Ryan Scott's avatar
    Make ppr_tc_args aware of -fprint-explicit-kinds · 113bdb8b
    Ryan Scott authored
    Summary:
    `ppr_tc_args` was printing invisible kind arguments even
    when `-fprint-explicit-kinds` wasn't enabled. Easily fixed.
    
    Test Plan: make test TEST=T15341
    
    Reviewers: goldfire, bgamari, simonpj
    
    Reviewed By: simonpj
    
    Subscribers: simonpj, rwbarton, thomie, carter
    
    GHC Trac Issues: #15341
    
    Differential Revision: https://phabricator.haskell.org/D4932
    
    (cherry picked from commit dbdcacfc)
    113bdb8b
  • Ryan Scott's avatar
    Fix #15331 with careful blasts of parenthesizeHsType · f663e507
    Ryan Scott authored
    Another `-ddump-splices` bug that can be solved with more
    judicious use of parentheses.
    
    Test Plan: make test TEST=T15331
    
    Reviewers: goldfire, bgamari, alanz, tdammers
    
    Reviewed By: tdammers
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15331
    
    Differential Revision: https://phabricator.haskell.org/D4920
    
    (cherry picked from commit b6a33861)
    f663e507
  • Ryan Scott's avatar
    Parenthesize rank-n contexts in Convert · a6a83d9a
    Ryan Scott authored
    Summary: A simple oversight.
    
    Test Plan: make test TEST=T15324
    
    Reviewers: goldfire, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15324
    
    Differential Revision: https://phabricator.haskell.org/D4910
    
    (cherry picked from commit 57733978)
    a6a83d9a
  • Matthew Pickering's avatar
    Export findImportUsage and ImportDeclUsage · 423a8eff
    Matthew Pickering authored
    Reviewers: bgamari, alpmestan
    
    Reviewed By: alpmestan
    
    Subscribers: alpmestan, rwbarton, thomie, carter
    
    GHC Trac Issues: #15335
    
    Differential Revision: https://phabricator.haskell.org/D4927
    
    (cherry picked from commit 2b1adaa7)
    423a8eff
  • Alan Zimmerman's avatar
    Fix mkGadtDecl does not set con_forall correctly · a39b58d5
    Alan Zimmerman authored and Ben Gamari's avatar Ben Gamari committed
    A GADT declaration surrounded in parens does not det the con_forall
    field correctly.
    
    e.g.
    
    data MaybeDefault v where
        TestParens  :: (forall v . (Eq v) => MaybeDefault v)
    
    Closes #15323
    
    (cherry picked from commit 6e4e6d1c)
    a39b58d5
  • Matthías Páll Gissurarson's avatar
    Fix errors caused by invalid candidates leaking from hole fits · 22c951e6
    Matthías Páll Gissurarson authored and Ben Gamari's avatar Ben Gamari committed
    This is a one line fix (and a note) that fixes four tickets, #15007,
     #15321 and #15202, #15314
    
    The issue was that errors caused by illegal candidates (according to GHC
    stage or being internal names) were leaking to the user, causing
    bewildering error messages. If a candidate causes the type checker to
    error, it is not a valid hole fit, and should be discarded.
    
    As mentioned in #15321, this can cause a pattern of omissions, which
    might be hard to discover. A better approach would be to gather the
    error messages, and ask users to report them as GHC bugs. This will be
    implemented in a subsequent change.
    
    Reviewers: bgamari, simonpj
    
    Reviewed By: simonpj
    
    Subscribers: simonpj, rwbarton, thomie, carter
    
    GHC Trac Issues: #15007, #15321, #15202, #15314
    
    Differential Revision: https://phabricator.haskell.org/D4909
    
    (cherry picked from commit 39de4e3d)
    22c951e6
  • Ömer Sinan Ağacan's avatar
    Add regression test for #15321 · 1fca115b
    Ömer Sinan Ağacan authored
    (cherry picked from commit e835fdb1)
    1fca115b
  • Ryan Scott's avatar
    Fix newtype instance GADTs · eb680f2c
    Ryan Scott authored
    Summary: This was taken from Richard's branch, which in turn was
    submitted to Phab by Matthew, which in turn was commandeered by Ryan.
    
    This fixes an issue with newtype instances in which too many
    coercions were being applied in the worker. This fixes the issue by
    removing the data family instance axiom from the worker and moving
    to the wrapper. Moreover, we now require all newtype instances
    to have wrappers, for symmetry with data instances.
    
    Reviewers: goldfire, bgamari, simonpj, mpickering
    
    Reviewed By: mpickering
    
    Subscribers: simonpj, rwbarton, thomie, carter
    
    GHC Trac Issues: #15318
    
    Differential Revision: https://phabricator.haskell.org/D4902
    
    (cherry picked from commit 92751866)
    eb680f2c
  • Matthew Pickering's avatar
    Run the renamed source plugin after each HsGroup · b52cfe41
    Matthew Pickering authored
    This allows modification of each `HsGroup` after it has been renamed.
    
    The old behaviour of keeping the renamed source until later can be
    recovered if desired by using the `keepRenamedSource` plugin but it
    shouldn't really be necessary as it can be inspected in the `TcGblEnv`.
    
    Reviewers: nboldi, bgamari, alpmestan
    
    Reviewed By: nboldi, alpmestan
    
    Subscribers: alpmestan, rwbarton, thomie, carter
    
    GHC Trac Issues: #15315
    
    Differential Revision: https://phabricator.haskell.org/D4947
    
    (cherry picked from commit 1a79270c)
    b52cfe41
  • Simon Peyton Jones's avatar
    Add commnent about binder order · 42396113
    Simon Peyton Jones authored
    ...provoked by Trac #15308
    
    (cherry picked from commit 3d002087)
    42396113
  • Ryan Scott's avatar
    Fix #15308 by suppressing invisble args more rigorously · 9bcbb222
    Ryan Scott authored
    Summary:
    There was a buglet in `stripInvisArgs` (which is part of the
    pretty-printing pipeline for types) in which only invisble arguments
    which came before any visible arguments would be suppressed, but any
    invisble arguments that came //after// visible ones would still be
    printed, even if `-fprint-explicit-kinds`  wasn't enabled.
    The fix is simple: make `stripInvisArgs` recursively process the
    remaining types even after a visible argument is encountered.
    
    Test Plan: make test TEST=T15308
    
    Reviewers: goldfire, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: simonpj, rwbarton, thomie, carter
    
    GHC Trac Issues: #15308
    
    Differential Revision: https://phabricator.haskell.org/D4891
    
    (cherry picked from commit 93b7ac8d)
    9bcbb222
  • Ryan Scott's avatar
    Fix #15307 by making nlHsFunTy parenthesize more · 92925b3d
    Ryan Scott authored
    Summary:
    `nlHsFunTy` wasn't parenthesizing its arguments at all,
    which led to `-ddump-deriv` producing incorrectly parenthesized
    types (since it uses `nlHsFunTy` to construct those types), as
    demonstrated in #15307. Fix this by changing `nlHsFunTy` to add
    parentheses à la `ppr_ty`: always parenthesizing the argument type
    with function precedence, and recursively processing the result type,
    adding parentheses for each function type it encounters.
    
    Test Plan: make test TEST=T14578
    
    Reviewers: bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15307
    
    Differential Revision: https://phabricator.haskell.org/D4890
    
    (cherry picked from commit 59a15a56)
    92925b3d
  • Simon Peyton Jones's avatar
    Add nakedSubstTy and use it in TcHsType.tcInferApps · cfc4afad
    Simon Peyton Jones authored
    This was a tricky one.
    
    During type checking we maintain TcType:
       Note [The well-kinded type invariant]
    That is, types are well-kinded /without/ zonking.
    
    But in tcInferApps we were destroying that invariant by calling
    substTy, which in turn uses smart constructors, which eliminate
    apparently-redundant Refl casts.
    
    This is horribly hard to debug beause they really are Refls and
    so it "ought" to be OK to discard them. But it isn't, as the
    above Note describes in some detail.
    
    Maybe we should review the invariant?  But for now I just followed
    it, tricky thought it is.
    
    This popped up because (for some reason) when I fixed Trac #15343,
    that exposed this bug by making test polykinds/T14174a fail (in
    Trac #14174 which indeed has the same origin).
    
    So this patch fixes a long standing and very subtle bug.
    
    One interesting point: I defined nakedSubstTy in a few lines by
    using the generic mapType stuff.  I note that the "normal"
    TyCoRep.substTy does /not/ use mapType.  But perhaps it should:
    substTy has lots of $! strict applications in it, and they could
    all be eliminated just by useing the StrictIdentity monad.  And
    that'd make it much easier to experiment with switching between
    strict and lazy versions.
    
    (cherry picked from commit 5067b205)
    cfc4afad
  • Richard Eisenberg's avatar
    Kind-check CUSK associated types separately · d0dfc5cc
    Richard Eisenberg authored and Ben Gamari's avatar Ben Gamari committed
    Previously, we kind-checked associated types while while still
    figuring out the kind of a CUSK class. This caused trouble, as
    documented in Note [Don't process associated types in kcLHsQTyVars]
    in TcTyClsDecls. This commit moves this process after the initial
    kind of the class is determined.
    
    Fixes #15142.
    
    Test case: indexed-types/should_compile/T15142.hs
    
    (cherry picked from commit 030211d2)
    d0dfc5cc
  • Ömer Sinan Ağacan's avatar
    Fix nptr field alignment in RtClosureInspect · 23b4d83f
    Ömer Sinan Ağacan authored
    `extractSubTerms` (which is extracting pointer and non-pointer fields of a
    closure) was computing the alignment incorrectly when aligning a 64-bit value
    (e.g. a Double) on i386 by aligning it to 64-bits instead of to word size
    (32-bits). This is documented in `mkVirtHeapOffsetsWithPadding`:
    
    > Align the start offset (eg, 2-byte value should be 2-byte aligned).
    > But not more than to a word.
    
    Fixes #15061
    
    Test Plan:
    Validated on both 32-bit and 64-bit. 32-bit fails with various unrelated stat
    failures, but no actual test failures.
    
    Reviewers: hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: simonpj, rwbarton, thomie, carter
    
    GHC Trac Issues: #15061
    
    Differential Revision: https://phabricator.haskell.org/D4906
    
    (cherry picked from commit 15bb4e0b)
    23b4d83f
  • Ryan Scott's avatar
    Instantiate GND bindings with an explicit type signature · c0323d97
    Ryan Scott authored
    Summary:
    Before, we were using visible type application to apply
    impredicative types to `coerce` in
    `GeneralizedNewtypeDeriving`-generated bindings. This approach breaks
    down when combined with `QuantifiedConstraints` in certain ways,
    which #14883 and #15290 provide examples of. See
    Note [GND and QuantifiedConstraints] for all the gory details.
    
    To avoid this issue, we instead use an explicit type signature to
    instantiate each GND binding, and use that to bind any type variables
    that might be bound by a class method's type signature. This reduces
    the need to impredicative type applications, and more importantly,
    makes the programs from #14883 and #15290 work again.
    
    Test Plan: make test TEST="T15290b T15290c T15290d T14883"
    
    Reviewers: simonpj, bgamari
    
    Reviewed By: simonpj
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #14883, #15290
    
    Differential Revision: https://phabricator.haskell.org/D4895
    
    (cherry picked from commit 132273f3)
    c0323d97
  • Simon Marlow's avatar
    submodule update · e5b1ec95
    Simon Marlow authored and Ben Gamari's avatar Ben Gamari committed
    (cherry picked from commit e40eb738)
    e5b1ec95
  • Ben Gamari's avatar
    Bump haskeline submodule to 0.7.4.3 · 148310fd
    Ben Gamari authored
    (cherry picked from commit cbd4b333)
    148310fd
  • Ben Gamari's avatar
    Bump mtl submodule to v2.2.2 · 736f4bce
    Ben Gamari authored
    (cherry picked from commit c67cf9e9)
    736f4bce
  • Ben Gamari's avatar
    Bump directory submodule to v1.3.3.0 · ca59fa76
    Ben Gamari authored
    (cherry picked from commit b794c7ed)
    ca59fa76
  • Ben Gamari's avatar
    Bump unix submodule · 3f965941
    Ben Gamari authored
    (cherry picked from commit c3328ff3)
    3f965941
  • Ben Gamari's avatar
    Remove random submodule · 391ee977
    Ben Gamari authored
    I believe this was originally introduced to help test DPH, which is now
    gone.
    
    (cherry picked from commit 0905fec0)
    391ee977
  • Simon Peyton Jones's avatar
    Fix decompsePiCos and visible type application · 5b10d537
    Simon Peyton Jones authored
    Trac #15343 was caused by two things
    
    First, in TcHsType.tcHsTypeApp, which deals with the type argment
    in visible type application, we were failing to call
    solveLocalEqualities. But the type argument is like a user type
    signature so it's at least inconsitent not to do so.
    
    I thought that would nail it.  But it didn't. It turned out that we
    were ended up calling decomposePiCos on a type looking like this
        (f |> co) Int
    
    where co :: (forall a. ty) ~ (t1 -> t2)
    
    Now, 'co' is insoluble, and we'll report that later.  But meanwhile
    we don't want to crash in decomposePiCos.
    
    My fix involves keeping track of the type on both sides of the
    coercion, and ensuring that the outer shape matches before
    decomposing.  I wish there was a simpler way to do this. But
    I think this one is at least robust.
    
    I suppose it is possible that the decomposePiCos fix would
    have cured the original report, but I'm leaving the one-line
    tcHsTypeApp fix in too because it just seems more consistent.
    
    (cherry picked from commit aedbf7f1)
    5b10d537
  • Simon Marlow's avatar
    Fix deadlock between STM and throwTo · 1cdc3ecc
    Simon Marlow authored and Ben Gamari's avatar Ben Gamari committed
    There was a lock-order reversal between lockTSO() and the TVar lock,
    see #15136 for the details.
    
    It turns out we can fix this pretty easily by just deleting all the
    locking code(!).  The principle for unblocking a `BlockedOnSTM` thread
    then becomes the same as for other kinds of blocking: if the TSO
    belongs to this capability then we do it directly, otherwise we send a
    message to the capability that owns the TSO. That is, a thread blocked
    on STM is owned by its capability, as it should be.
    
    The possible downside of this is that we might send multiple messages
    to wake up a thread when the thread is on another capability. This is
    safe, it's just not very efficient.  I'll try to do some experiments
    to see if this is a problem.
    
    Test Plan: Test case from #15136 doesn't deadlock any more.
    
    Reviewers: bgamari, osa1, erikd
    
    Reviewed By: osa1
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15136
    
    Differential Revision: https://phabricator.haskell.org/D4956
    
    (cherry picked from commit 7fc418df)
    1cdc3ecc
  • Ömer Sinan Ağacan's avatar
    Fix processHeapClosureForDead CONSTR_NOCAF case · 30a4bcc3
    Ömer Sinan Ağacan authored
    CONSTR_NOCAF was introduced with 55d535da as a replacement for
    CONSTR_STATIC and CONSTR_NOCAF_STATIC, however, as explained in Note
    [static constructors], we copy CONSTR_NOCAFs (which can also be seen in
    evacuate) during GC, and they can become dead, like other CONSTR_X_Ys.
    processHeapClosureForDead is updated to reflect this.
    
    Test Plan: Validates on x86_64. Existing failures on i386.
    
    Reviewers: simonmar, bgamari, erikd
    
    Reviewed By: simonmar, bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #7836, #15063, #15087, #15165
    
    Differential Revision: https://phabricator.haskell.org/D4928
    
    (cherry picked from commit 2625f131)
    30a4bcc3
Showing
with 187 additions and 108 deletions
......@@ -19,8 +19,7 @@ module MkId (
mkPrimOpId, mkFCallId,
wrapNewTypeBody, unwrapNewTypeBody,
wrapFamInstBody,
unwrapNewTypeBody, wrapFamInstBody,
DataConBoxer(..), mkDataConRep, mkDataConWorkId,
-- And some particular Ids; see below for why they are wired in
......@@ -247,6 +246,47 @@ Hence we translate to
-- Coercion from family type to representation type
Co7T a :: T [a] ~ :R7T a
Newtype instances through an additional wrinkle into the mix. Consider the
following example (adapted from #15318, comment:2):
data family T a
newtype instance T [a] = MkT [a]
Within the newtype instance, there are three distinct types at play:
1. The newtype's underlying type, [a].
2. The instance's representation type, TList a (where TList is the
representation tycon).
3. The family type, T [a].
We need two coercions in order to cast from (1) to (3):
(a) A newtype coercion axiom:
axiom coTList a :: TList a ~ [a]
(Where TList is the representation tycon of the newtype instance.)
(b) A data family instance coercion axiom:
axiom coT a :: T [a] ~ TList a
When we translate the newtype instance to Core, we obtain:
-- Wrapper
$WMkT :: forall a. [a] -> T [a]
$WMkT a x = MkT a x |> Sym (coT a)
-- Worker
MkT :: forall a. [a] -> TList [a]
MkT a x = x |> Sym (coTList a)
Unlike for data instances, the worker for a newtype instance is actually an
executable function which expands to a cast, but otherwise, the general
strategy is essentially the same as for data instances. Also note that we have
a wrapper, which is unusual for a newtype, but we make GHC produce one anyway
for symmetry with the way data instances are handled.
Note [Newtype datacons]
~~~~~~~~~~~~~~~~~~~~~~~
The "data constructor" for a newtype should always be vanilla. At one
......@@ -614,8 +654,8 @@ mkDataConRep dflags fam_envs wrap_name mb_bangs data_con
-- of some newtypes written with GADT syntax. See below.
&& (any isBanged (ev_ibangs ++ arg_ibangs)
-- Some forcing/unboxing (includes eq_spec)
|| isFamInstTyCon tycon -- Cast result
|| (not $ null eq_spec))) -- GADT
|| isFamInstTyCon tycon -- Cast result
|| dataConUserTyVarsArePermuted data_con
-- If the data type was written with GADT syntax and
-- orders the type variables differently from what the
......@@ -1009,15 +1049,9 @@ wrapNewTypeBody :: TyCon -> [Type] -> CoreExpr -> CoreExpr
--
-- If a coercion constructor is provided in the newtype, then we use
-- it, otherwise the wrap/unwrap are both no-ops
--
-- If the we are dealing with a newtype *instance*, we have a second coercion
-- identifying the family instance with the constructor of the newtype
-- instance. This coercion is applied in any case (ie, composed with the
-- coercion constructor of the newtype or applied by itself).
wrapNewTypeBody tycon args result_expr
= ASSERT( isNewTyCon tycon )
wrapFamInstBody tycon args $
mkCast result_expr (mkSymCo co)
where
co = mkUnbranchedAxInstCo Representational (newTyConCo tycon) args []
......
......@@ -1311,14 +1311,10 @@ pprLoc (UnhelpfulSpan {}) = empty
-- coming from GHC.TypeNats). In this case the user will get a kind
-- mismatch error. This is a violation of assumption (c).
--
-- Since NoStarIsType is implied by a fairly common extension TypeOperators,
-- the user might be working on a module with NoStarIsType unbeknownst to him.
-- Even if the user switched off StarIsType manually, he might have forgotten
-- about it and use '*' as 'Data.Kind.Type' out of habit.
--
-- Thus it is very important to give a hint whenever an assumption about '*' is
-- violated. Unfortunately, it is somewhat difficult to deal with (c), so we
-- limit ourselves to (a) and (b).
-- The user might unknowingly be working on a module with NoStarIsType
-- or use '*' as 'Data.Kind.Type' out of habit. So it is important to give a
-- hint whenever an assumption about '*' is violated. Unfortunately, it is
-- somewhat difficult to deal with (c), so we limit ourselves to (a) and (b).
--
-- 'starInfo' generates an appropriate hint to the user depending on the
-- extensions enabled in the module and the name that triggered the error.
......@@ -1326,10 +1322,10 @@ pprLoc (UnhelpfulSpan {}) = empty
-- Unicode variant, the resulting SDoc will contain a helpful suggestion.
-- Otherwise it is empty.
--
starInfo :: (Bool, Bool) -> RdrName -> SDoc
starInfo (type_operators, star_is_type) rdr_name =
starInfo :: Bool -> RdrName -> SDoc
starInfo star_is_type rdr_name =
-- One might ask: if can use sdocWithDynFlags here, why bother to take
-- (type_operators, star_is_type) as input? Why not refactor?
-- star_is_type as input? Why not refactor?
--
-- The reason is that sdocWithDynFlags would provide DynFlags that are active
-- in the module that tries to load the problematic definition, not
......@@ -1340,10 +1336,7 @@ starInfo (type_operators, star_is_type) rdr_name =
-- with StarIsType enabled!
--
if isUnqualStar && not star_is_type
then text "With NoStarIsType" <>
(if type_operators
then text " (implied by TypeOperators), "
else text ", ") <>
then text "With NoStarIsType, " <>
quotes (ppr rdr_name) <>
text " is treated as a regular type operator. "
$$
......
......@@ -810,7 +810,7 @@ addTickIPBind (IPBind x nm e) =
liftM2 (IPBind x)
(return nm)
(addTickLHsExpr e)
addTickIPBind (XCIPBind x) = return (XCIPBind x)
addTickIPBind (XIPBind x) = return (XIPBind x)
-- There is no location here, so we might need to use a context location??
addTickSyntaxExpr :: SrcSpan -> SyntaxExpr GhcTc -> TM (SyntaxExpr GhcTc)
......
......@@ -96,7 +96,7 @@ dsIPBinds (IPBinds ev_binds ip_binds) body
ds_ip_bind (L _ (IPBind _ ~(Right n) e)) body
= do e' <- dsLExpr e
return (Let (NonRec n e') body)
ds_ip_bind (L _ (XCIPBind _)) _ = panic "dsIPBinds"
ds_ip_bind (L _ (XIPBind _)) _ = panic "dsIPBinds"
dsIPBinds (XHsIPBinds _) _ = panic "dsIPBinds"
-------------------------
......
......@@ -781,11 +781,14 @@ extractSubTerms recurse clos = liftM thdOf3 . go 0 0
dflags <- getDynFlags
let word_size = wORD_SIZE dflags
size_b = primRepSizeB dflags rep
-- Fields are always aligned.
!aligned_idx = roundUpTo arr_i size_b
-- Align the start offset (eg, 2-byte value should be 2-byte
-- aligned). But not more than to a word. The offset calculation
-- should be the same with the offset calculation in
-- StgCmmLayout.mkVirtHeapOffsetsWithPadding.
!aligned_idx = roundUpTo arr_i (min word_size size_b)
!new_arr_i = aligned_idx + size_b
ws | size_b < word_size =
[index size_b array aligned_idx word_size]
[index size_b aligned_idx word_size]
| otherwise =
let (q, r) = size_b `quotRem` word_size
in ASSERT( r == 0 )
......@@ -800,7 +803,7 @@ extractSubTerms recurse clos = liftM thdOf3 . go 0 0
(error "unboxedTupleTerm: no HValue for unboxed tuple") terms
-- Extract a sub-word sized field from a word
index item_size_b array index_b word_size =
index item_size_b index_b word_size =
(word .&. (mask `shiftL` moveBytes)) `shiftR` moveBytes
where
mask :: Word
......
......@@ -818,7 +818,8 @@ cvtl e = wrapL (cvt e)
cvt (AppTypeE e t) = do { e' <- cvtl e
; t' <- cvtType t
; tp <- wrap_apps t'
; return $ HsAppType (mkHsWildCardBndrs tp) e' }
; let tp' = parenthesizeHsType appPrec tp
; return $ HsAppType (mkHsWildCardBndrs tp') e' }
cvt (LamE [] e) = cvt e -- Degenerate case. We convert the body as its
-- own expression to avoid pretty-printing
-- oddities that can result from zero-argument
......@@ -1283,7 +1284,9 @@ cvtTypeKind ty_str ty
x'' <- case x' of
L _ HsFunTy{} -> returnL (HsParTy noExt x')
L _ HsForAllTy{} -> returnL (HsParTy noExt x')
-- #14646
-- #14646
L _ HsQualTy{} -> returnL (HsParTy noExt x')
-- #15324
_ -> return x'
returnL (HsFunTy noExt x'' y')
| otherwise ->
......
......@@ -859,12 +859,12 @@ type LIPBind id = Located (IPBind id)
-- For details on above see note [Api annotations] in ApiAnnotation
data IPBind id
= IPBind
(XIPBind id)
(XCIPBind id)
(Either (Located HsIPName) (IdP id))
(LHsExpr id)
| XCIPBind (XXIPBind id)
| XIPBind (XXIPBind id)
type instance XIPBind (GhcPass p) = NoExt
type instance XCIPBind (GhcPass p) = NoExt
type instance XXIPBind (GhcPass p) = NoExt
instance (p ~ GhcPass pass, OutputableBndrId p)
......@@ -878,7 +878,7 @@ instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (IPBind p) where
where name = case lr of
Left (L _ ip) -> pprBndr LetBind ip
Right id -> pprBndr LetBind id
ppr (XCIPBind x) = ppr x
ppr (XIPBind x) = ppr x
{-
************************************************************************
......
......@@ -516,17 +516,11 @@ data TyClDecl pass
-- 'ApiAnnotation.AnnWhere',
-- For details on above see note [Api annotations] in ApiAnnotation
DataDecl { tcdDExt :: XDataDecl pass -- ^ Post renamer, CUSK flag, FVs
, tcdLName :: Located (IdP pass) -- ^ Type constructor
, tcdTyVars :: LHsQTyVars pass -- ^ Type variables; for an
-- associated type
-- these include outer binders
-- Eg class T a where
-- type F a :: *
-- type F a = a -> a
-- Here the type decl for 'f'
-- includes 'a' in its tcdTyVars
, tcdFixity :: LexicalFixity -- ^ Fixity used in the declaration
DataDecl { tcdDExt :: XDataDecl pass -- ^ Post renamer, CUSK flag, FVs
, tcdLName :: Located (IdP pass) -- ^ Type constructor
, tcdTyVars :: LHsQTyVars pass -- ^ Type variables
-- See Note [TyVar binders for associated declarations]
, tcdFixity :: LexicalFixity -- ^ Fixity used in the declaration
, tcdDataDefn :: HsDataDefn pass }
| ClassDecl { tcdCExt :: XClassDecl pass, -- ^ Post renamer, FVs
......@@ -539,8 +533,7 @@ data TyClDecl pass
tcdSigs :: [LSig pass], -- ^ Methods' signatures
tcdMeths :: LHsBinds pass, -- ^ Default methods
tcdATs :: [LFamilyDecl pass], -- ^ Associated types;
tcdATDefs :: [LTyFamDefltEqn pass],
-- ^ Associated type defaults
tcdATDefs :: [LTyFamDefltEqn pass], -- ^ Associated type defaults
tcdDocs :: [LDocDecl] -- ^ Haddock docs
}
-- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnClass',
......@@ -558,6 +551,27 @@ data DataDeclRn = DataDeclRn
, tcdFVs :: NameSet }
deriving Data
{- Note [TyVar binders for associated decls]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For an /associated/ data, newtype, or type-family decl, the LHsQTyVars
/includes/ outer binders. For example
class T a where
data D a c
type F a b :: *
type F a b = a -> a
Here the data decl for 'D', and type-family decl for 'F', both include 'a'
in their LHsQTyVars (tcdTyVars and fdTyVars resp).
Ditto any implicit binders in the hsq_implicit field of the LHSQTyVars.
The idea is that the associated type is really a top-level decl in its
own right. However we are careful to use the same name 'a', so that
we can match things up.
c.f. Note [Associated type tyvar names] in Class.hs
Note [Family instance declaration binders]
-}
type instance XFamDecl (GhcPass _) = NoExt
type instance XSynDecl GhcPs = NoExt
......@@ -966,6 +980,7 @@ data FamilyDecl pass = FamilyDecl
, fdInfo :: FamilyInfo pass -- type/data, closed/open
, fdLName :: Located (IdP pass) -- type constructor
, fdTyVars :: LHsQTyVars pass -- type variables
-- See Note [TyVar binders for associated declarations]
, fdFixity :: LexicalFixity -- Fixity used in the declaration
, fdResultSig :: LFamilyResultSig pass -- result signature
, fdInjectivityAnn :: Maybe (LInjectivityAnn pass) -- optional injectivity ann
......@@ -1490,6 +1505,8 @@ HsImplicitBndrs in FamInstEqn. Note in particular
For associated type family default instances (TyFamDefltEqn), instead of using
type patterns with binders in a surrounding HsImplicitBndrs, we use raw type
variables (LHsQTyVars) in the feqn_pats field of FamEqn.
c.f. Note [TyVar binders for associated declarations]
-}
-- | Type Family Instance Equation
......
......@@ -156,11 +156,11 @@ type ForallXHsIPBinds (c :: * -> Constraint) (x :: *) =
)
-- IPBind type families
type family XIPBind x
type family XCIPBind x
type family XXIPBind x
type ForallXIPBind (c :: * -> Constraint) (x :: *) =
( c (XIPBind x)
( c (XCIPBind x)
, c (XXIPBind x)
)
......
......@@ -1425,8 +1425,8 @@ ppr_tylit (HsStrTy _ s) = text (show s)
hsTypeNeedsParens :: PprPrec -> HsType pass -> Bool
hsTypeNeedsParens p = go
where
go (HsForAllTy{}) = False
go (HsQualTy{}) = False
go (HsForAllTy{}) = p >= funPrec
go (HsQualTy{}) = p >= funPrec
go (HsBangTy{}) = p > topPrec
go (HsRecTy{}) = False
go (HsTyVar{}) = False
......
......@@ -178,7 +178,10 @@ mkHsApp e1 e2 = addCLoc e1 e2 (HsApp noExt e1 e2)
mkHsAppType :: (XAppTypeE (GhcPass id) ~ LHsWcType GhcRn)
=> LHsExpr (GhcPass id) -> LHsWcType GhcRn -> LHsExpr (GhcPass id)
mkHsAppType e t = addCLoc e (hswc_body t) (HsAppType t e)
mkHsAppType e t = addCLoc e t_body (HsAppType paren_wct e)
where
t_body = hswc_body t
paren_wct = t { hswc_body = parenthesizeHsType appPrec t_body }
mkHsAppTypes :: LHsExpr GhcRn -> [LHsWcType GhcRn] -> LHsExpr GhcRn
mkHsAppTypes = foldl mkHsAppType
......@@ -497,7 +500,13 @@ nlHsParTy :: LHsType (GhcPass p) -> LHsType (GhcPass p)
nlHsAppTy f t = noLoc (HsAppTy noExt f (parenthesizeHsType appPrec t))
nlHsTyVar x = noLoc (HsTyVar noExt NotPromoted (noLoc x))
nlHsFunTy a b = noLoc (HsFunTy noExt a b)
nlHsFunTy a b = noLoc (HsFunTy noExt (parenthesizeHsType funPrec a)
(parenthesize_fun_tail b))
where
parenthesize_fun_tail (L loc (HsFunTy ext ty1 ty2))
= L loc (HsFunTy ext (parenthesizeHsType funPrec ty1)
(parenthesize_fun_tail ty2))
parenthesize_fun_tail lty = lty
nlHsParTy t = noLoc (HsParTy noExt t)
nlHsTyConApp :: IdP (GhcPass p) -> [LHsType (GhcPass p)] -> LHsType (GhcPass p)
......@@ -694,7 +703,7 @@ The derived Eq instance for Glurp (without any kind signatures) would be:
instance Eq a => Eq (Glurp a) where
(==) = coerce @(Wat 'Proxy -> Wat 'Proxy -> Bool)
@(Glurp a -> Glurp a -> Bool)
(==)
(==) :: Glurp a -> Glurp a -> Bool
(Where the visible type applications use types produced by typeToLHsType.)
......
......@@ -513,8 +513,13 @@ stripInvisArgs dflags tys
where
suppress_invis c
= case c of
ITC_Nil -> ITC_Nil
ITC_Invis _ ts -> suppress_invis ts
_ -> c
ITC_Vis t ts -> ITC_Vis t $ suppress_invis ts
-- Keep recursing through the remainder of the arguments, as it's
-- possible that there are remaining invisible ones.
-- See the "In type declarations" section of Note [TyVarBndrs,
-- TyVarBinders, TyConBinders, and visibility] in TyCoRep.
tcArgsIfaceTypes :: IfaceTcArgs -> [IfaceType]
tcArgsIfaceTypes ITC_Nil = []
......@@ -819,11 +824,15 @@ pprParendIfaceTcArgs = ppr_tc_args appPrec
ppr_tc_args :: PprPrec -> IfaceTcArgs -> SDoc
ppr_tc_args ctx_prec args
= let pprTys t ts = ppr_ty ctx_prec t <+> ppr_tc_args ctx_prec ts
= let ppr_rest = ppr_tc_args ctx_prec
pprTys t ts = ppr_ty ctx_prec t <+> ppr_rest ts
in case args of
ITC_Nil -> empty
ITC_Vis t ts -> pprTys t ts
ITC_Invis t ts -> pprTys t ts
ITC_Invis t ts -> sdocWithDynFlags $ \dflags ->
if gopt Opt_PrintExplicitKinds dflags
then pprTys t ts
else ppr_rest ts
-------------------
pprIfaceForAllPart :: [IfaceForAllBndr] -> [IfacePredType] -> SDoc -> SDoc
......
......@@ -814,6 +814,7 @@ data WarningFlag =
| Opt_WarnMissingExportList
| Opt_WarnInaccessibleCode
| Opt_WarnStarIsType -- Since 8.6
| Opt_WarnStarBinder -- Since 8.6
| Opt_WarnImplicitKindVars -- Since 8.6
deriving (Eq, Show, Enum)
......@@ -3859,6 +3860,7 @@ wWarningFlagsDeps = [
flagSpec "simplifiable-class-constraints" Opt_WarnSimplifiableClassConstraints,
flagSpec "missing-home-modules" Opt_WarnMissingHomeModules,
flagSpec "unrecognised-warning-flags" Opt_WarnUnrecognisedWarningFlags,
flagSpec "star-binder" Opt_WarnStarBinder,
flagSpec "star-is-type" Opt_WarnStarIsType,
flagSpec "partial-fields" Opt_WarnPartialFields ]
......@@ -4362,7 +4364,6 @@ impliedXFlags
, (LangExt.TypeInType, turnOn, LangExt.DataKinds)
, (LangExt.TypeInType, turnOn, LangExt.PolyKinds)
, (LangExt.TypeInType, turnOn, LangExt.KindSignatures)
, (LangExt.TypeInType, turnOff, LangExt.StarIsType)
-- AutoDeriveTypeable is not very useful without DeriveDataTypeable
, (LangExt.AutoDeriveTypeable, turnOn, LangExt.DeriveDataTypeable)
......@@ -4374,9 +4375,6 @@ impliedXFlags
, (LangExt.ImpredicativeTypes, turnOn, LangExt.RankNTypes)
-- See Note [When is StarIsType enabled]
, (LangExt.TypeOperators, turnOff, LangExt.StarIsType)
-- Record wild-cards implies field disambiguation
-- Otherwise if you write (C {..}) you may well get
-- stuff like " 'a' not in scope ", which is a bit silly
......@@ -4404,12 +4402,10 @@ impliedXFlags
-- programs expect '*' to be synonymous with 'Type', so by default StarIsType is
-- enabled.
--
-- However, programs that use TypeOperators might expect to repurpose '*' for
-- multiplication or another binary operation, so we make TypeOperators imply
-- NoStarIsType.
-- Programs that use TypeOperators might expect to repurpose '*' for
-- multiplication or another binary operation, but making TypeOperators imply
-- NoStarIsType caused too much breakage on Hackage.
--
-- It is still possible to have TypeOperators and StarIsType enabled at the same
-- time, although it's not recommended.
-- Note [Documenting optimisation flags]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -4559,6 +4555,7 @@ standardWarnings -- see Note [Documenting warning flags]
Opt_WarnTabs,
Opt_WarnUnrecognisedWarningFlags,
Opt_WarnSimplifiableClassConstraints,
Opt_WarnStarBinder,
Opt_WarnInaccessibleCode
]
......
......@@ -85,7 +85,6 @@ module HscMain
import GhcPrelude
import Data.Data hiding (Fixity, TyCon)
import Data.Maybe ( isJust )
import DynFlags (addPluginModuleName)
import Id
import GHCi ( addSptEntry )
......@@ -455,14 +454,10 @@ tcRnModule' sum save_rn_syntax mod = do
hsc_env <- getHscEnv
dflags <- getDynFlags
-- check if plugins need the renamed syntax
let plugin_needs_rn = any (isJust . renamedResultAction . lpPlugin)
(plugins dflags)
tcg_res <- {-# SCC "Typecheck-Rename" #-}
ioMsgMaybe $
tcRnModule hsc_env sum
(save_rn_syntax || plugin_needs_rn) mod
save_rn_syntax mod
-- See Note [Safe Haskell Overlapping Instances Implementation]
-- although this is used for more than just that failure case.
......
......@@ -3,7 +3,7 @@
module Plugins (
FrontendPlugin(..), defaultFrontendPlugin, FrontendPluginAction
, Plugin(..), CommandLineOption, LoadedPlugin(..), lpModuleName
, defaultPlugin, withPlugins, withPlugins_
, defaultPlugin, keepRenamedSource, withPlugins, withPlugins_
, PluginRecompile(..)
, purePlugin, impurePlugin, flagRecompile
) where
......@@ -12,14 +12,13 @@ import GhcPrelude
import {-# SOURCE #-} CoreMonad ( CoreToDo, CoreM )
import qualified TcRnTypes
import TcRnTypes ( TcGblEnv, IfM, TcM )
import TcRnTypes ( TcGblEnv, IfM, TcM, tcg_rn_decls, tcg_rn_exports )
import HsSyn
import DynFlags
import HscTypes
import GhcMonad
import DriverPhases
import Module ( ModuleName, Module(moduleName))
import Avail
import Fingerprint
import Data.List
import Outputable (Outputable(..), text, (<+>))
......@@ -58,10 +57,10 @@ data Plugin = Plugin {
-> Hsc HsParsedModule
-- ^ Modify the module when it is parsed. This is called by
-- HscMain when the parsing is successful.
, renamedResultAction :: Maybe ([CommandLineOption] -> ModSummary
-> RenamedSource -> TcM ())
-- ^ Installs a read-only pass that receives the renamed syntax tree as an
-- argument when type checking is successful.
, renamedResultAction :: [CommandLineOption] -> TcGblEnv
-> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)
-- ^ Modify each group after it is renamed. This is called after each
-- `HsGroup` has been renamed.
, typeCheckResultAction :: [CommandLineOption] -> ModSummary -> TcGblEnv
-> TcM TcGblEnv
-- ^ Modify the module when it is type checked. This is called add the
......@@ -82,8 +81,7 @@ data Plugin = Plugin {
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- The `Plugin` datatype have been extended by fields that allow access to the
-- different inner representations that are generated during the compilation
-- process. These fields are `parsedResultAction`, `needsRenamedSyntax` (for
-- controlling when renamed representation is kept during typechecking),
-- process. These fields are `parsedResultAction`, `renamedResultAction`,
-- `typeCheckResultAction`, `spliceRunAction` and `interfaceLoadAction`.
--
-- The main purpose of these plugins is to help tool developers. They allow
......@@ -149,19 +147,32 @@ defaultPlugin = Plugin {
installCoreToDos = const return
, tcPlugin = const Nothing
, pluginRecompile = impurePlugin
, renamedResultAction = Nothing
, renamedResultAction = \_ env grp -> return (env, grp)
, parsedResultAction = \_ _ -> return
, typeCheckResultAction = \_ _ -> return
, spliceRunAction = \_ -> return
, interfaceLoadAction = \_ -> return
}
-- | A renamer plugin which mades the renamed source available in
-- a typechecker plugin.
keepRenamedSource :: [CommandLineOption] -> TcGblEnv
-> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)
keepRenamedSource _ gbl_env group =
return (gbl_env { tcg_rn_decls = update (tcg_rn_decls gbl_env)
, tcg_rn_exports = update_exports (tcg_rn_exports gbl_env) }, group)
where
update_exports Nothing = Just []
update_exports m = m
update Nothing = Just emptyRnGroup
update m = m
type PluginOperation m a = Plugin -> [CommandLineOption] -> a -> m a
type ConstPluginOperation m a = Plugin -> [CommandLineOption] -> a -> m ()
type RenamedSource = ( HsGroup GhcRn, [LImportDecl GhcRn]
, Maybe [(LIE GhcRn, Avails)], Maybe LHsDocString )
-- | Perform an operation by using all of the plugins in turn.
withPlugins :: Monad m => DynFlags -> PluginOperation m a -> a -> m a
withPlugins df transformation input
......
......@@ -68,7 +68,6 @@ module Lexer (
explicitNamespacesEnabled,
patternSynonymsEnabled,
sccProfilingOn, hpcEnabled,
typeOperatorsEnabled,
starIsTypeEnabled,
addWarning,
lexTokenStream,
......@@ -2264,7 +2263,6 @@ data ExtBits
| TypeApplicationsBit
| StaticPointersBit
| NumericUnderscoresBit
| TypeOperatorsBit
| StarIsTypeBit
deriving Enum
......@@ -2334,8 +2332,6 @@ staticPointersEnabled :: ExtsBitmap -> Bool
staticPointersEnabled = xtest StaticPointersBit
numericUnderscoresEnabled :: ExtsBitmap -> Bool
numericUnderscoresEnabled = xtest NumericUnderscoresBit
typeOperatorsEnabled :: ExtsBitmap -> Bool
typeOperatorsEnabled = xtest TypeOperatorsBit
starIsTypeEnabled :: ExtsBitmap -> Bool
starIsTypeEnabled = xtest StarIsTypeBit
......@@ -2392,7 +2388,6 @@ mkParserFlags flags =
.|. TypeApplicationsBit `xoptBit` LangExt.TypeApplications
.|. StaticPointersBit `xoptBit` LangExt.StaticPointers
.|. NumericUnderscoresBit `xoptBit` LangExt.NumericUnderscores
.|. TypeOperatorsBit `xoptBit` LangExt.TypeOperators
.|. StarIsTypeBit `xoptBit` LangExt.StarIsType
optBits =
HaddockBit `goptBit` Opt_Haddock
......
......@@ -1882,7 +1882,8 @@ is connected to the first type too.
type :: { LHsType GhcPs }
: btype { $1 }
| btype '->' ctype {% ams (sLL $1 $> $ HsFunTy noExt $1 $3)
| btype '->' ctype {% ams $1 [mu AnnRarrow $2] -- See note [GADT decl discards annotations]
>> ams (sLL $1 $> $ HsFunTy noExt $1 $3)
[mu AnnRarrow $2] }
......@@ -1929,9 +1930,9 @@ tyapp :: { Located TyEl }
| qtyconop { sL1 $1 $ TyElOpr (unLoc $1) }
| tyvarop { sL1 $1 $ TyElOpr (unLoc $1) }
| SIMPLEQUOTE qconop {% ams (sLL $1 $> $ TyElOpr (unLoc $2))
[mj AnnSimpleQuote $1] }
[mj AnnSimpleQuote $1,mj AnnVal $2] }
| SIMPLEQUOTE varop {% ams (sLL $1 $> $ TyElOpr (unLoc $2))
[mj AnnSimpleQuote $1] }
[mj AnnSimpleQuote $1,mj AnnVal $2] }
atype_docs :: { LHsType GhcPs }
: atype docprev { sLL $1 $> $ HsDocTy noExt $1 $2 }
......
......@@ -643,13 +643,13 @@ mkGadtDecl :: [Located RdrName]
mkGadtDecl names ty
= (ConDeclGADT { con_g_ext = noExt
, con_names = names
, con_forall = L l $ isLHsForAllTy ty
, con_forall = L l $ isLHsForAllTy ty'
, con_qvars = mkHsQTvs tvs
, con_mb_cxt = mcxt
, con_args = args'
, con_res_ty = res_ty
, con_doc = Nothing }
, anns1 ++ anns2 ++ anns3)
, anns1 ++ anns2)
where
(ty'@(L l _),anns1) = peel_parens ty []
(tvs, rho) = splitLHsForAllTy ty'
......@@ -660,14 +660,13 @@ mkGadtDecl names ty
split_rho (L l (HsParTy _ ty)) ann = split_rho ty (ann++mkParensApiAnn l)
split_rho tau ann = (Nothing, tau, ann)
(args, res_ty, anns3) = split_tau tau []
(args, res_ty) = split_tau tau
args' = nudgeHsSrcBangs args
-- See Note [GADT abstract syntax] in HsDecls
split_tau (L _ (HsFunTy _ (L loc (HsRecTy _ rf)) res_ty)) ann
= (RecCon (L loc rf), res_ty, ann)
split_tau (L l (HsParTy _ ty)) ann = split_tau ty (ann++mkParensApiAnn l)
split_tau tau ann = (PrefixCon [], tau, ann)
split_tau (L _ (HsFunTy _ (L loc (HsRecTy _ rf)) res_ty))
= (RecCon (L loc rf), res_ty)
split_tau tau = (PrefixCon [], tau)
peel_parens (L l (HsParTy _ ty)) ann = peel_parens ty
(ann++mkParensApiAnn l)
......@@ -871,6 +870,12 @@ checkTyClHdr is_cls ty
where
goL (L l ty) acc ann fix = go l ty acc ann fix
-- workaround to define '*' despite StarIsType
go _ (HsParTy _ (L l (HsStarTy _ isUni))) acc ann fix
= do { warnStarBndr l
; let name = mkOccName tcClsName (if isUni then "★" else "*")
; return (L l (Unqual name), acc, fix, ann) }
go l (HsTyVar _ _ (L _ tc)) acc ann fix
| isRdrTc tc = return (L l tc, acc, fix, ann)
go _ (HsOpTy _ t1 ltc@(L _ tc) t2) acc ann _fix
......@@ -1748,11 +1753,19 @@ warnStarIsType span = addWarning Opt_WarnStarIsType span msg
$$ text "Suggested fix: use" <+> quotes (text "Type")
<+> text "from" <+> quotes (text "Data.Kind") <+> text "instead."
warnStarBndr :: SrcSpan -> P ()
warnStarBndr span = addWarning Opt_WarnStarBinder span msg
where
msg = text "Desugaring" <+> quotes (text "*") <+> text "in a binder"
<+> text "position as a type operator despite StarIsType."
$$ text "NB. To use (or export) this operator in"
<+> text "modules with StarIsType,"
$$ text " including the definition module, you must qualify it."
failOpFewArgs :: Located RdrName -> P a
failOpFewArgs (L loc op) =
do { type_operators <- extension typeOperatorsEnabled
; star_is_type <- extension starIsTypeEnabled
; let msg = too_few $$ starInfo (type_operators, star_is_type) op
do { star_is_type <- extension starIsTypeEnabled
; let msg = too_few $$ starInfo star_is_type op
; parseErrorSDoc loc msg }
where
too_few = text "Operator applied to too few arguments:" <+> ppr op
......
......@@ -226,7 +226,7 @@ rnIPBind :: IPBind GhcPs -> RnM (IPBind GhcRn, FreeVars)
rnIPBind (IPBind _ ~(Left n) expr) = do
(expr',fvExpr) <- rnLExpr expr
return (IPBind noExt (Left n) expr', fvExpr)
rnIPBind (XCIPBind _) = panic "rnIPBind"
rnIPBind (XIPBind _) = panic "rnIPBind"
{-
************************************************************************
......
......@@ -930,9 +930,8 @@ lookup_demoted rdr_name
| Just demoted_rdr <- demoteRdrName rdr_name
-- Maybe it's the name of a *data* constructor
= do { data_kinds <- xoptM LangExt.DataKinds
; type_operators <- xoptM LangExt.TypeOperators
; star_is_type <- xoptM LangExt.StarIsType
; let star_info = starInfo (type_operators, star_is_type) rdr_name
; let star_info = starInfo star_is_type rdr_name
; if data_kinds
then do { mb_demoted_name <- lookupOccRn_maybe demoted_rdr
; case mb_demoted_name of
......