未验证 提交 432d19fd 编写于 作者: S Steffen Forkmann 提交者: GitHub

Remove isAppTy (#9246)

上级 ac9485f4
......@@ -208,12 +208,13 @@ and IsTypeInstAccessible g amap m ad tinst =
/// Indicate if a provided member is accessible
let IsProvidedMemberAccessible (amap:Import.ImportMap) m ad ty access =
let g = amap.g
let isTyAccessible = IsTypeAccessible g amap m ad ty
if not isTyAccessible then false
if IsTypeAccessible g amap m ad ty then
match tryTcrefOfAppTy g ty with
| ValueNone -> true
| ValueSome tcrefOfViewedItem ->
IsILMemberAccessible g amap m tcrefOfViewedItem ad access
else
not (isAppTy g ty) ||
let tcrefOfViewedItem = tcrefOfAppTy g ty
IsILMemberAccessible g amap m tcrefOfViewedItem ad access
false
/// Compute the accessibility of a provided member
let ComputeILAccess isPublic isFamily isFamilyOrAssembly isFamilyAndAssembly =
......
......@@ -542,7 +542,11 @@ let ConvertSequenceExprToObject g amap overallExpr =
// printfn "FAILED - not worth compiling an unrecognized immediate yield! %s " (stringOfRange m)
None
else
let tyConfirmsToSeq g ty = isAppTy g ty && tyconRefEq g (tcrefOfAppTy g ty) g.tcref_System_Collections_Generic_IEnumerable
let tyConfirmsToSeq g ty =
match tryTcrefOfAppTy g ty with
| ValueSome tcref ->
tyconRefEq g tcref g.tcref_System_Collections_Generic_IEnumerable
| _ -> false
match SearchEntireHierarchyOfType (tyConfirmsToSeq g) g amap m (tyOfExpr g arbitrarySeqExpr) with
| None ->
// printfn "FAILED - yield! did not yield a sequence! %s" (stringOfRange m)
......
......@@ -848,8 +848,8 @@ let MakeMethInfoCall amap m minfo minst args =
let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap: Import.ImportMap, m: range, mbase: Tainted<ProvidedMethodBase>) =
let methodName = mbase.PUntaint((fun x -> x.Name), m)
let declaringType = Import.ImportProvidedType amap m (mbase.PApply((fun x -> x.DeclaringType), m))
if isAppTy amap.g declaringType then
let declaringEntity = tcrefOfAppTy amap.g declaringType
match tryTcrefOfAppTy amap.g declaringType with
| ValueSome declaringEntity ->
if not declaringEntity.IsLocalRef && ccuEq declaringEntity.nlr.Ccu amap.g.fslibCcu then
match amap.g.knownIntrinsics.TryGetValue ((declaringEntity.LogicalName, methodName)) with
| true, vref -> Some vref
......@@ -861,7 +861,7 @@ let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap: Import.ImportMap, m: ra
| _ -> None
else
None
else
| _ ->
None
#endif
......
......@@ -2398,10 +2398,10 @@ let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInf
| _ -> ()
let errorTextF s =
if isAppTy g ty then
let tcref = tcrefOfAppTy g ty
match tryTcrefOfAppTy g ty with
| ValueSome tcref ->
FSComp.SR.undefinedNameFieldConstructorOrMemberWhenTypeIsKnown(tcref.DisplayNameWithStaticParametersAndTypars, s)
else
| _ ->
FSComp.SR.undefinedNameFieldConstructorOrMember(s)
raze (UndefinedName (depth, errorTextF, id, suggestMembers))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册