Skip to content
  • Simon Peyton Jones's avatar
    Fix desugaring of pattern bindings (again) · 2fbfbca2
    Simon Peyton Jones authored
    This patch fixes Trac #12595.  The problem was with a
    pattern binding like
         !x = e
    For a start it's silly to match that pattern and build
    a unit tuple (the General Case of mkSelectorBinds); but
    that's what was happening because the bang fell through
    to the general case.  But for a variable pattern building
    any auxiliary bindings is stupid.  So the patch
    introduces a new case in mkSelectorBinds for variable
    patterns.
    
    Then it turned out that if 'e' was a plain variable, and
    moreover was imported GlobalId, then matchSinglePat made
    it a /bound/ variable, which should never happen.  That
    ultimately caused a linker error, but the original bug
    was much earlier.
    2fbfbca2