Skip to content

Commit

Permalink
Restrict fix for dotnet#44 to F# Interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyme committed Jan 20, 2015
1 parent 1b2f9fc commit 80dbab8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/fsharp/tc.fs
Expand Up @@ -607,14 +607,15 @@ let BuildRootModuleExpr enclosingNamespacePath cpath mexpr =
||> List.foldBack (fun id (cpath, mexpr) -> (parentCompPath cpath, wrapModuleOrNamespaceExprInNamespace id (parentCompPath cpath) mexpr))
|> snd

let ImplicitlyOpenOwnNamespace tcSink g amap scopem (enclosingNamespacePath: Ident list) env =
let ImplicitlyOpenOwnNamespace tcSink (g:TcGlobals) amap scopem (enclosingNamespacePath: Ident list) env =
if isNil enclosingNamespacePath then
env
else
// Skip "FSI_0002" prefixes when determining the path to open implicitly
// For F# interactive, skip "FSI_0002" prefixes when determining the path to open implicitly
let enclosingNamespacePathToOpen =
match enclosingNamespacePath with
| p::rest when p.idText.StartsWith(FsiDynamicModulePrefix,System.StringComparison.Ordinal) &&
| p::rest when g.isInteractive &&
p.idText.StartsWith(FsiDynamicModulePrefix,System.StringComparison.Ordinal) &&
p.idText.[FsiDynamicModulePrefix.Length..] |> String.forall System.Char.IsDigit &&
rest.Length > 0 -> rest
| rest -> rest
Expand Down

0 comments on commit 80dbab8

Please sign in to comment.