@@ -607,14 +607,15 @@ let BuildRootModuleExpr enclosingNamespacePath cpath mexpr =
607607 ||> List.foldBack (fun id (cpath, mexpr) -> (parentCompPath cpath, wrapModuleOrNamespaceExprInNamespace id (parentCompPath cpath) mexpr))
608608 |> snd
609609
610- let ImplicitlyOpenOwnNamespace tcSinkg amap scopem (enclosingNamespacePath: Ident list) env =
610+ let ImplicitlyOpenOwnNamespace tcSink(g:TcGlobals) amap scopem (enclosingNamespacePath: Ident list) env =
611611 if isNil enclosingNamespacePath then
612612 env
613613 else
614- //Skip "FSI_0002" prefixes when determining the path to open implicitly
614+ //For F# interactive, skip "FSI_0002" prefixes when determining the path to open implicitly
615615 let enclosingNamespacePathToOpen =
616616 match enclosingNamespacePath with
617- | p::rest when p.idText.StartsWith(FsiDynamicModulePrefix,System.StringComparison.Ordinal) &&
617+ | p::rest when g.isInteractive &&
618+ p.idText.StartsWith(FsiDynamicModulePrefix,System.StringComparison.Ordinal) &&
618619 p.idText.[FsiDynamicModulePrefix.Length..] |> String.forall System.Char.IsDigit &&
619620 rest.Length > 0 -> rest
620621 | rest -> rest