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