You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
/// Resolve a long identifier using type-qualified name resolution.
460
-
valinternalResolveLongIdentInType:TcResultsSink->NameResolver->NameResolutionEnv->LookupKind->range->AccessorDomain->Identlist->FindMemberFlag->TypeNameResolutionInfo->TType->Item* Ident list
460
+
valinternalResolveLongIdentInType:TcResultsSink->NameResolver->NameResolutionEnv->LookupKind->range->AccessorDomain->Ident->FindMemberFlag->TypeNameResolutionInfo->TType->Item* Ident list
461
461
462
462
/// Resolve a long identifier when used in a pattern.
Copy file name to clipboardExpand all lines: src/fsharp/TypeChecker.fs
+34-19Lines changed: 34 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -697,13 +697,16 @@ let ImplicitlyOpenOwnNamespace tcSink g amap scopem enclosingNamespacePath env =
697
697
| Some(_, rest) -> rest
698
698
| None -> enclosingNamespacePath
699
699
700
-
let ad = env.eAccessRights
701
-
match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap scopem OpenQualified env.eNameResEnv ad enclosingNamespacePathToOpen true with
702
-
| Result modrefs ->
703
-
let modrefs = List.map p23 modrefs
704
-
let openDecl = OpenDeclaration.Create (enclosingNamespacePathToOpen, modrefs, scopem, true)
705
-
OpenModulesOrNamespaces tcSink g amap scopem false env modrefs openDecl
706
-
| Exception _ -> env
700
+
match enclosingNamespacePathToOpen with
701
+
| id::rest ->
702
+
let ad = env.eAccessRights
703
+
match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap scopem true OpenQualified env.eNameResEnv ad id rest true with
704
+
| Result modrefs ->
705
+
let modrefs = List.map p23 modrefs
706
+
let openDecl = OpenDeclaration.Create (enclosingNamespacePathToOpen, modrefs, scopem, true)
707
+
OpenModulesOrNamespaces tcSink g amap scopem false env modrefs openDecl
@@ -6805,7 +6808,7 @@ and TcConstExpr cenv overallTy env m tpenv c =
6805
6808
let expr =
6806
6809
let modName = "NumericLiteral" + suffix
6807
6810
let ad = env.eAccessRights
6808
-
match ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AtMostOneResult cenv.amap m OpenQualified env.eNameResEnv ad[ident (modName, m)] false with
6811
+
match ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AtMostOneResult cenv.amap mtrueOpenQualified env.eNameResEnv ad(ident (modName, m)) [] false with
attributeAssignedNamedItems |> List.map (fun (CallerNamedArg(id, CallerArg(argtyv, m, isOpt, callerArgExpr))) ->
10633
10636
if isOpt then error(Error(FSComp.SR.tcOptionalArgumentsCannotBeUsedInCustomAttribute(), m))
10634
10637
let m = callerArgExpr.Range
10635
-
let setterItem, _ = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr m ad[id] IgnoreOverrides TypeNameResolutionInfo.Default ty
10638
+
let setterItem, _ = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr m adid IgnoreOverrides TypeNameResolutionInfo.Default ty
/// Check a "module X = A.B.C" module abbreviation declaration
13582
13588
let TcModuleAbbrevDecl (cenv:cenv) scopem env (id, p, m) =
13583
13589
let ad = env.eAccessRights
13584
-
let mvvs = ForceRaise (ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m OpenQualified env.eNameResEnv ad p false)
13585
-
let modrefs = mvvs |> List.map p23
13586
-
if not (List.isEmpty modrefs) && modrefs |> List.forall (fun modref -> modref.IsNamespace) then
13590
+
let resolved =
13591
+
match p with
13592
+
| [] -> Result []
13593
+
| id::rest -> ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m true OpenQualified env.eNameResEnv ad id rest false
13594
+
let mvvs = ForceRaise resolved
13595
+
if isNil mvvs then env else
13596
+
let modrefs = mvvs |> List.map p23
13597
+
if not (isNil modrefs) && modrefs |> List.forall (fun modref -> modref.IsNamespace) then
let mvvs = ForceRaise (ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m OpenQualified env.eNameResEnv ad p false)
16378
+
let resolved =
16379
+
match p with
16380
+
| [] -> Result []
16381
+
| id::rest -> ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m true OpenQualified env.eNameResEnv ad id rest false