@@ -826,7 +826,7 @@ let tcrefOfAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) ->
826826let argsOfAppTy g ty = ty |> stripTyEqns g |> ( function TType_ app(_, tinst) -> tinst | _ -> [])
827827let tryDestTyparTy g ty = ty |> stripTyEqns g |> ( function TType_ var v -> ValueSome v | _ -> ValueNone)
828828let tryDestFunTy g ty = ty |> stripTyEqns g |> ( function TType_ fun ( tyv, tau) -> ValueSome( tyv, tau) | _ -> ValueNone)
829- let tryDestAppTy g ty = ty |> stripTyEqns g |> ( function TType_ app( tcref, _) -> ValueSome tcref | _ -> ValueNone)
829+ let tryTcrefOfAppTy g ty = ty |> stripTyEqns g |> ( function TType_ app( tcref, _) -> ValueSome tcref | _ -> ValueNone)
830830let tryDestAnonRecdTy g ty = ty |> stripTyEqns g |> ( function TType_ anon ( anonInfo, tys) -> ValueSome ( anonInfo, tys) | _ -> ValueNone)
831831
832832let tryAnyParTy g ty = ty |> stripTyEqns g |> ( function TType_ var v -> ValueSome v | TType_ measure unt when isUnitParMeasure g unt -> ValueSome( destUnitParMeasure g unt) | _ -> ValueNone)
@@ -1707,17 +1707,17 @@ let isFSharpObjModelRefTy g ty =
17071707 | TTyconStruct | TTyconEnum -> false
17081708
17091709let isFSharpClassTy g ty =
1710- match tryDestAppTy g ty with
1710+ match tryTcrefOfAppTy g ty with
17111711 | ValueSome tcref -> tcref.Deref.IsFSharpClassTycon
17121712 | _ -> false
17131713
17141714let isFSharpStructTy g ty =
1715- match tryDestAppTy g ty with
1715+ match tryTcrefOfAppTy g ty with
17161716 | ValueSome tcref -> tcref.Deref.IsFSharpStructOrEnumTycon
17171717 | _ -> false
17181718
17191719let isFSharpInterfaceTy g ty =
1720- match tryDestAppTy g ty with
1720+ match tryTcrefOfAppTy g ty with
17211721 | ValueSome tcref -> tcref.Deref.IsFSharpInterfaceTycon
17221722 | _ -> false
17231723
@@ -1728,7 +1728,7 @@ let isDelegateTy g ty =
17281728#endif
17291729 | ILTypeMetadata ( TILObjectReprData(_, _, td)) -> td.IsDelegate
17301730 | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata ->
1731- match tryDestAppTy g ty with
1731+ match tryTcrefOfAppTy g ty with
17321732 | ValueSome tcref -> tcref.Deref.IsFSharpDelegateTycon
17331733 | _ -> false
17341734
@@ -1749,12 +1749,12 @@ let isClassTy g ty =
17491749 | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> isFSharpClassTy g ty
17501750
17511751let isStructOrEnumTyconTy g ty =
1752- match tryDestAppTy g ty with
1752+ match tryTcrefOfAppTy g ty with
17531753 | ValueSome tcref -> tcref.Deref.IsStructOrEnumTycon
17541754 | _ -> false
17551755
17561756let isStructRecordOrUnionTyconTy g ty =
1757- match tryDestAppTy g ty with
1757+ match tryTcrefOfAppTy g ty with
17581758 | ValueSome tcref -> tcref.Deref.IsStructRecordOrUnionTycon
17591759 | _ -> false
17601760
@@ -1763,7 +1763,7 @@ let isStructTyconRef (tcref: TyconRef) =
17631763 tycon.IsStructRecordOrUnionTycon || tycon.IsStructOrEnumTycon
17641764
17651765let isStructTy g ty =
1766- match tryDestAppTy g ty with
1766+ match tryTcrefOfAppTy g ty with
17671767 | ValueSome tcref ->
17681768 isStructTyconRef tcref
17691769 | _ ->
@@ -1794,7 +1794,7 @@ let isRefTy g ty =
17941794// [Note: Constructed types and type-parameters are never unmanaged-types. end note]
17951795let rec isUnmanagedTy g ty =
17961796 let ty = stripTyEqnsAndMeasureEqns g ty
1797- match tryDestAppTy g ty with
1797+ match tryTcrefOfAppTy g ty with
17981798 | ValueSome tcref ->
17991799 let isEq tcref2 = tyconRefEq g tcref tcref2
18001800 if isEq g.nativeptr_ tcr || isEq g.nativeint_ tcr ||
@@ -1826,7 +1826,7 @@ let isInterfaceTycon x =
18261826let isInterfaceTyconRef ( tcref : TyconRef ) = isInterfaceTycon tcref.Deref
18271827
18281828let isEnumTy g ty =
1829- match tryDestAppTy g ty with
1829+ match tryTcrefOfAppTy g ty with
18301830 | ValueNone -> false
18311831 | ValueSome tcref -> tcref.IsEnumTycon
18321832
@@ -3084,7 +3084,7 @@ let destNativePtrTy g ty =
30843084 | _ -> failwith " destNativePtrTy: not a native ptr type"
30853085
30863086let isRefCellTy g ty =
3087- match tryDestAppTy g ty with
3087+ match tryTcrefOfAppTy g ty with
30883088 | ValueNone -> false
30893089 | ValueSome tcref -> tyconRefEq g g.refcell_ tcr_ canon tcref
30903090
@@ -3109,7 +3109,7 @@ let mkOptionTy (g: TcGlobals) ty = TType_app (g.option_tcr_nice, [ty])
31093109let mkListTy ( g : TcGlobals ) ty = TType_ app ( g.list_ tcr_ nice, [ ty])
31103110
31113111let isOptionTy ( g : TcGlobals ) ty =
3112- match tryDestAppTy g ty with
3112+ match tryTcrefOfAppTy g ty with
31133113 | ValueNone -> false
31143114 | ValueSome tcref -> tyconRefEq g g.option_ tcr_ canon tcref
31153115
@@ -3124,7 +3124,7 @@ let destOptionTy g ty =
31243124 | ValueNone -> failwith " destOptionTy: not an option type"
31253125
31263126let isNullableTy ( g : TcGlobals ) ty =
3127- match tryDestAppTy g ty with
3127+ match tryTcrefOfAppTy g ty with
31283128 | ValueNone -> false
31293129 | ValueSome tcref -> tyconRefEq g g.system_ Nullable_ tcref tcref
31303130
@@ -3149,7 +3149,7 @@ let (|StripNullableTy|) g ty =
31493149 | _ -> ty
31503150
31513151let isLinqExpressionTy g ty =
3152- match tryDestAppTy g ty with
3152+ match tryTcrefOfAppTy g ty with
31533153 | ValueNone -> false
31543154 | ValueSome tcref -> tyconRefEq g g.system_ LinqExpression_ tcref tcref
31553155
@@ -4877,7 +4877,7 @@ let decideStaticOptimizationConstraint g c =
48774877 checkTypes a b
48784878 | TTyconIsStruct a ->
48794879 let a = normalizeEnumTy g ( stripTyEqnsAndMeasureEqns g a)
4880- match tryDestAppTy g a with
4880+ match tryTcrefOfAppTy g a with
48814881 | ValueSome tcref1 -> if tcref1.IsStructOrEnumTycon then StaticOptimizationAnswer.Yes else StaticOptimizationAnswer.No
48824882 | ValueNone -> StaticOptimizationAnswer.Unknown
48834883
@@ -5986,7 +5986,7 @@ let isRecdOrStructTyconRefReadOnly g m tcref =
59865986 isRecdOrStructTyconRefReadOnlyAux g m false tcref
59875987
59885988let isRecdOrStructTyReadOnlyAux ( g : TcGlobals ) m isInref ty =
5989- match tryDestAppTy g ty with
5989+ match tryTcrefOfAppTy g ty with
59905990 | ValueNone -> false
59915991 | ValueSome tcref -> isRecdOrStructTyconRefReadOnlyAux g m isInref tcref
59925992
@@ -6532,7 +6532,7 @@ let mkMinusOne g m = mkInt g m (-1)
65326532let destInt32 = function Expr.Const ( Const.Int32 n, _, _) -> Some n | _ -> None
65336533
65346534let isIDelegateEventType g ty =
6535- match tryDestAppTy g ty with
6535+ match tryTcrefOfAppTy g ty with
65366536 | ValueSome tcref -> tyconRefEq g g.fslib_ IDelegateEvent_ tcr tcref
65376537 | _ -> false
65386538
@@ -7956,15 +7956,15 @@ let TypeNullNever g ty =
79567956let TypeNullIsExtraValue g m ty =
79577957 if isILReferenceTy g ty || isDelegateTy g ty then
79587958 // Putting AllowNullLiteralAttribute(false) on an IL or provided type means 'null' can't be used with that type
7959- not ( match tryDestAppTy g ty with ValueSome tcref -> TryFindTyconRefBoolAttribute g m g.attrib_ AllowNullLiteralAttribute tcref = Some false | _ -> false )
7959+ not ( match tryTcrefOfAppTy g ty with ValueSome tcref -> TryFindTyconRefBoolAttribute g m g.attrib_ AllowNullLiteralAttribute tcref = Some false | _ -> false )
79607960 elif TypeNullNever g ty then
79617961 false
79627962 else
79637963 // Putting AllowNullLiteralAttribute(true) on an F# type means 'null' can be used with that type
7964- match tryDestAppTy g ty with ValueSome tcref -> TryFindTyconRefBoolAttribute g m g.attrib_ AllowNullLiteralAttribute tcref = Some true | _ -> false
7964+ match tryTcrefOfAppTy g ty with ValueSome tcref -> TryFindTyconRefBoolAttribute g m g.attrib_ AllowNullLiteralAttribute tcref = Some true | _ -> false
79657965
79667966let TypeNullIsTrueValue g ty =
7967- ( match tryDestAppTy g ty with
7967+ ( match tryTcrefOfAppTy g ty with
79687968 | ValueSome tcref -> IsUnionTypeWithNullAsTrueValue g tcref.Deref
79697969 | _ -> false ) || ( isUnitTy g ty)
79707970
0 commit comments