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
let rec check overallTyOpt expr (delayed: DelayedItem list) =
9273
+
let rec check overallTyOpt resultOpt expr (delayed: DelayedItem list) =
9274
9274
match expr with
9275
-
| LongOrSingleIdent (false, (LongIdentWithDots((id::rest) as longId, _) as lidd), _, _) ->
9275
+
| LongOrSingleIdent (false, (LongIdentWithDots(longId, _) as lidd), _, _) ->
9276
9276
let ad = env.eAccessRights
9277
-
match ResolveLongIndentAsModuleOrNamespaceOrStaticClass cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m false true OpenQualified env.eNameResEnv ad id rest true with
9278
-
| Result modref when delayed.IsEmpty && modref |> List.exists (p23 >> IsEntityAccessible cenv.amap m ad) ->
9279
-
() // resolved to a module or namespace, done with checks
9280
-
| _ ->
9281
-
let (TypeNameResolutionInfo(_, staticArgsInfo)) = GetLongIdentTypeNameInfo delayed
9282
-
match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInAttribute OpenQualified env.eNameResEnv ad longId staticArgsInfo PermitDirectReferenceToGeneratedType.No with
9283
-
| Result tcref when IsEntityAccessible cenv.amap m ad tcref ->
9284
-
() // resolved to a type name, done with checks
9285
-
| _ ->
9286
-
let overallTy = match overallTyOpt with None -> NewInferenceType() | Some t -> t
let result = defaultArg resultOpt (List.last longId)
9278
+
let resolvedToModuleOrNamespaceName =
9279
+
if delayed.IsEmpty then
9280
+
let id,rest = List.headAndTail longId
9281
+
match ResolveLongIndentAsModuleOrNamespaceOrStaticClass cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m false true OpenQualified env.eNameResEnv ad id rest true with
9282
+
| Result modref when delayed.IsEmpty && modref |> List.exists (p23 >> IsEntityAccessible cenv.amap m ad) ->
9283
+
true // resolved to a module or namespace, done with checks
9284
+
| _ ->
9285
+
false
9286
+
else
9287
+
false
9288
+
if resolvedToModuleOrNamespaceName then result else
9289
+
9290
+
let resolvedToTypeName =
9291
+
if (match delayed with [DelayedTypeApp _] | [] -> true | _ -> false) then
9292
+
let (TypeNameResolutionInfo(_, staticArgsInfo)) = GetLongIdentTypeNameInfo delayed
9293
+
match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInAttribute OpenQualified env.eNameResEnv ad longId staticArgsInfo PermitDirectReferenceToGeneratedType.No with
9294
+
| Result tcref when (match delayed with [DelayedTypeApp _] | [] -> true | _ -> false) && IsEntityAccessible cenv.amap m ad tcref ->
9295
+
true // resolved to a type name, done with checks
9296
+
| _ ->
9297
+
false
9298
+
else
9299
+
false
9300
+
if resolvedToTypeName then result else
9290
9301
9302
+
let overallTy = match overallTyOpt with None -> NewInferenceType() | Some t -> t
9303
+
9304
+
// This will raise an error if resolution doesn't succeed
0 commit comments