Skip to content

Commit 99d317a

Browse files
committed
Squashed commit of the following:
commit cd1f270 Author: Eugene Auduchinok <eugene.auduchinok@jetbrains.com> Date: Mon Feb 16 17:44:59 2026 +0100 Fantomas commit 4edb3dc Author: Eugene Auduchinok <eugene.auduchinok@gmail.com> Date: Mon Feb 16 17:12:08 2026 +0100 Release notes commit b737ebc Author: Eugene Auduchinok <eugene.auduchinok@jetbrains.com> Date: Mon Feb 16 16:54:21 2026 +0100 FCS: capture additional types during analysis commit e82d6f6 Author: Tomas Grosup <Tomas.Grosup@gmail.com> Date: Mon Feb 16 12:56:35 2026 +0100 Create SKILL.md (dotnet#19282) commit 01bad01 Author: Tomas Grosup <Tomas.Grosup@gmail.com> Date: Thu Feb 12 21:49:32 2026 +0100 Find All References and Rename Symbol Bug Fixes (dotnet#19252) FCS: add more predefined types checks
1 parent 84dece3 commit 99d317a

2 files changed

Lines changed: 66 additions & 28 deletions

File tree

src/Compiler/Symbols/Symbols.fs

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,24 +2571,55 @@ type FSharpType(cenv, ty:TType) =
25712571

25722572
member _.IsMeasureType =
25732573
isResolved() &&
2574-
protect <| fun () ->
2575-
match stripTyparEqns ty with
2576-
| TType_measure _ -> true
2577-
| _ -> false
2574+
protect <| fun () -> isMeasureTy cenv.g ty
25782575

25792576
member _.IsTupleType =
25802577
isResolved() &&
2581-
protect <| fun () ->
2582-
match stripTyparEqns ty with
2583-
| TType_tuple _ -> true
2584-
| _ -> false
2578+
protect <| fun () -> isRefTupleTy cenv.g ty
25852579

25862580
member _.IsStructTupleType =
25872581
isResolved() &&
2588-
protect <| fun () ->
2589-
match stripTyparEqns ty with
2590-
| TType_tuple (tupInfo, _) -> evalTupInfoIsStruct tupInfo
2591-
| _ -> false
2582+
protect <| fun () -> isStructTupleTy cenv.g ty
2583+
2584+
member _.IsUnitType =
2585+
isResolved () &&
2586+
protect <| fun () -> isUnitTy cenv.g ty
2587+
2588+
member _.IsArrayType =
2589+
isResolved () &&
2590+
protect <| fun () -> isArrayTy cenv.g ty
2591+
2592+
member _.IsNativePointerType =
2593+
isResolved () &&
2594+
protect <| fun () -> isNativePtrTy cenv.g ty
2595+
2596+
member _.IsFSharpList =
2597+
isResolved () &&
2598+
protect <| fun () -> isListTy cenv.g ty
2599+
2600+
member _.IsFSharpChoice =
2601+
isResolved () &&
2602+
protect <| fun () -> isChoiceTy cenv.g ty
2603+
2604+
member _.IsFSharpOption =
2605+
isResolved () &&
2606+
protect <| fun () -> isOptionTy cenv.g ty
2607+
2608+
member _.IsFSharpValueOption =
2609+
isResolved () &&
2610+
protect <| fun () -> isValueOptionTy cenv.g ty
2611+
2612+
member _.IsStringType =
2613+
isResolved () &&
2614+
protect <| fun () -> isStringTy cenv.g ty
2615+
2616+
member _.IsObjectType =
2617+
isResolved () &&
2618+
protect <| fun () -> isObjTyAnyNullness cenv.g ty
2619+
2620+
member _.IsBooleanType =
2621+
isResolved () &&
2622+
protect <| fun () -> isBoolTy cenv.g ty
25922623

25932624
member _.TypeDefinition =
25942625
protect <| fun () ->
@@ -2647,17 +2678,11 @@ type FSharpType(cenv, ty:TType) =
26472678

26482679
member _.IsFunctionType =
26492680
isResolved() &&
2650-
protect <| fun () ->
2651-
match stripTyparEqns ty with
2652-
| TType_fun _ -> true
2653-
| _ -> false
2681+
protect <| fun () -> isFunTy cenv.g ty
26542682

26552683
member _.IsAnonRecordType =
26562684
isResolved() &&
2657-
protect <| fun () ->
2658-
match stripTyparEqns ty with
2659-
| TType_anon _ -> true
2660-
| _ -> false
2685+
protect <| fun () -> isAnonRecdTy cenv.g ty
26612686

26622687
member _.AnonRecordTypeDetails =
26632688
protect <| fun () ->
@@ -2690,17 +2715,18 @@ type FSharpType(cenv, ty:TType) =
26902715
GetSuperTypeOfType cenv.g cenv.amap range0 ty
26912716
|> Option.map (fun ty -> FSharpType(cenv, ty))
26922717

2693-
member x.ErasedType=
2718+
member x.ErasedType =
26942719
FSharpType(cenv, stripTyEqnsWrtErasure EraseAll cenv.g ty)
26952720

26962721
member x.BasicQualifiedName =
2697-
protect <| fun () ->
2698-
match stripTyparEqns ty with
2699-
| TType_app(tcref, _, _) ->
2700-
match tcref.CompiledRepresentation with
2701-
| CompiledTypeRepr.ILAsmNamed(tref, _, _) -> Some tref.BasicQualifiedName
2702-
| CompiledTypeRepr.ILAsmOpen _ -> None
2703-
| _ -> None
2722+
if isUnresolved () then None else
2723+
2724+
match stripTyparEqns ty with
2725+
| TType_app(tcref, _, _) ->
2726+
match tcref.CompiledRepresentation with
2727+
| CompiledTypeRepr.ILAsmNamed(tref, _, _) -> Some tref.BasicQualifiedName
2728+
| CompiledTypeRepr.ILAsmOpen _ -> None
2729+
| _ -> None
27042730

27052731
member _.Instantiate(instantiation:(FSharpGenericParameter * FSharpType) list) =
27062732
let resTy = instType (instantiation |> List.map (fun (tyv, ty) -> tyv.TypeParameter, ty.Type)) ty

src/Compiler/Symbols/Symbols.fsi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,18 @@ type FSharpType =
11251125
/// Indicates if the type is a struct tuple type. The GenericArguments property returns the elements of the tuple type.
11261126
member IsStructTupleType: bool
11271127

1128+
member IsArrayType: bool
1129+
1130+
member IsNativePointerType: bool
1131+
member IsUnitType: bool
1132+
member IsFSharpList: bool
1133+
member IsFSharpChoice: bool
1134+
member IsFSharpOption: bool
1135+
member IsFSharpValueOption: bool
1136+
member IsStringType: bool
1137+
member IsObjectType: bool
1138+
member IsBooleanType: bool
1139+
11281140
/// Indicates if the type is a function type. The GenericArguments property returns the domain and range of the function type.
11291141
member IsFunctionType: bool
11301142

0 commit comments

Comments
 (0)