Skip to content
  • Ryan Scott's avatar
    Be mindful of GADT tyvar order when desugaring record updates · 2d308da2
    Ryan Scott authored
    After commit ef26182e,
    the type variable binders in GADT constructor type signatures
    are now quantified in toposorted order, instead of always having
    all the universals before all the existentials. Unfortunately, that
    commit forgot to update some code (which was assuming the latter
    scenario) in `DsExpr` which desugars record updates. This wound
    up being the cause of #15499.
    
    This patch makes up for lost time by desugaring record updates in
    a way such that the desugared expression applies type arguments to
    the right-hand side constructor in the correct order—that is, the
    order in which they were quantified by the user.
    
    Test Plan: make test TEST=T15499
    
    Reviewers: simonpj, bgamari
    
    Reviewed By: simonpj
    
    Subscribers: rwbarton, carter
    
    GHC Trac Issues: #15499
    
    Differential Revision: https://phabricator.haskell.org/D5060
    
    (cherry picked from commit 63b6a1d4)
    2d308da2