Consider this code:
namespace Ns
type Rec = { F: int }
namespace Ns
module M =
let _: R{caret}
The two Ns fragments are analyzed sequentially and types from the first fragment are available in the second one. While checking the code, various intermediate name resolution environments are captured, so the IDE features could reuse them later. The code completion feature picks a dubious environment where Rec type is missing for some reason.