initGlobalEnv :: Unif r => TcRsc r -> ClassHierarchy r -> TCM r (TCEnv r)
--------------------------------------------------------------------------------
initGlobalEnv (Rsc { code = Src ss }) cha = do
    nms   <- either fatal return (symEnv ss)
    return $ TCE nms bnds ctx pth cha mut tThis fId
  where
    bnds  = mempty
    ctx   = emptyContext
    pth   = emptyPath
    mut   = Nothing
    tThis = Nothing
    fId   = (-1)

-- This will be called *last* on every contructor, method, function.
-- It is transparent to the incoming environment's: path, cha, mut, this
--
-- TODO: Shadow `this` binding (in case this is a class context)
--
--------------------------------------------------------------------------------
initGlobalEnv :: Unif r => TcRsc r -> ClassHierarchy r -> TCM r (TCEnv r)
initGlobalEnv (Rsc { code = Src ss }) cha = do
    nms   <- either fatal return (symEnv ss)
    return $ TCE nms bnds ctx pth cha mut tThis fId
  where
    bnds  = mempty
    ctx   = emptyContext
    pth   = emptyPath
    mut   = Nothing
    tThis = Nothing
    fId   = (-1)

-- This will be called *last* on every contructor, method, function.
-- It is transparent to the incoming environment's: path, cha, mut, this
--
-- TODO: Shadow `this` binding (in case this is a class context)
--
--------------------------------------------------------------------------------
initGlobalEnv (Rsc { code = Src ss }) cha = do
    nms   <- either fatal return (symEnv ss)
    return $ TCE nms bnds ctx pth cha mut tThis fId
  where
    bnds  = mempty
    ctx   = emptyContext
    pth   = emptyPath
    mut   = Nothing
    tThis = Nothing
    fId   = (-1)

-- This will be called *last* on every contructor, method, function.
-- It is transparent to the incoming environment's: path, cha, mut, this
--
-- TODO: Shadow `this` binding (in case this is a class context)
--
--------------------------------------------------------------------------------