Skip to content
  • Simon Peyton Jones's avatar
    Make Core Lint check for locally-bound GlobalIds · d59c59f4
    Simon Peyton Jones authored
    There should be no bindings in this module for a GlobalId;
    except after CoreTidy, when top-level bindings are globalised.
    
    To check for this, I had to make the CoreToDo pass part of the
    environment that Core Lint caries.  But CoreToDo is defined in
    CoreMonad, which (before this patch) called CoreLint.
    
    So I had to do quite a bit of refactoring, moving some
    lint-invoking code into CoreLint itself.  Crucially, I also
    more tcLookupImported_maybe, importDecl, and checkwiredInTyCon
    from TcIface (which use CoreLint) to LoadIface (which doesn't).
    This is probably better structure anyway.
    
    So most of this patch is refactoring. The actual check for
    GlobalIds is in CoreLint.lintAndScopeId
    d59c59f4