Skip to content

Commit 1f29259

Browse files
T-GroCopilot
andcommitted
Split TypeConstruction into MeasureOps, TypeBuilders, TypeAbbreviations, TypeDecomposition
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8aa25b1 commit 1f29259

3 files changed

Lines changed: 1120 additions & 2 deletions

File tree

src/Compiler/TypedTree/TypedTreeOps.Remap.fs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ module internal TypeRemapping =
505505
let mkTyconRefInst (tcref: TyconRef) tinst = mkTyconInst tcref.Deref tinst
506506

507507
[<AutoOpen>]
508-
module internal TypeConstruction =
508+
module internal MeasureOps =
509509

510510
//---------------------------------------------------------------------------
511511
// Basic equalities
@@ -727,6 +727,9 @@ module internal TypeConstruction =
727727
| _ -> ty
728728
| _ -> ty
729729

730+
[<AutoOpen>]
731+
module internal TypeBuilders =
732+
730733
//---------------------------------------------------------------------------
731734
// Some basic type builders
732735
//---------------------------------------------------------------------------
@@ -869,6 +872,9 @@ module internal TypeConstruction =
869872
TType_app(tcref, tysA @ [ marker ], g.knownWithoutNull)
870873
| _ -> TType_app(tcref, tysA @ [ TType_tuple(mkTupInfo isStruct, tysB) ], g.knownWithoutNull)
871874

875+
[<AutoOpen>]
876+
module internal TypeAbbreviations =
877+
872878
//---------------------------------------------------------------------------
873879
// Remove inference equations and abbreviations from types
874880
//---------------------------------------------------------------------------
@@ -908,6 +914,9 @@ module internal TypeConstruction =
908914
let reduceTyconRefMeasureableOrProvided (g: TcGlobals) (tcref: TyconRef) tyargs =
909915
reduceTyconMeasureableOrProvided g tcref.Deref tyargs
910916

917+
[<AutoOpen>]
918+
module internal TypeDecomposition =
919+
911920
let rec stripTyEqnsA g canShortcut ty =
912921
let ty = stripTyparEqnsAux KnownWithoutNull canShortcut ty
913922

src/Compiler/TypedTree/TypedTreeOps.Remap.fsi

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ module internal TypeRemapping =
200200
val mkTyconRefInst: TyconRef -> TypeInst -> TyparInstantiation
201201

202202
[<AutoOpen>]
203-
module internal TypeConstruction =
203+
module internal MeasureOps =
204204

205205
/// Equality for type definition references
206206
val tyconRefEq: TcGlobals -> TyconRef -> TyconRef -> bool
@@ -244,6 +244,9 @@ module internal TypeConstruction =
244244

245245
val tryNormalizeMeasureInType: TcGlobals -> TType -> TType
246246

247+
[<AutoOpen>]
248+
module internal TypeBuilders =
249+
247250
val mkForallTy: Typars -> TType -> TType
248251

249252
/// Build a type-forall anonymous generic type if necessary
@@ -299,6 +302,9 @@ module internal TypeConstruction =
299302
/// Convert from F# tuple types to .NET tuple types, but only the outermost level
300303
val mkOuterCompiledTupleTy: TcGlobals -> bool -> TTypes -> TType
301304

305+
[<AutoOpen>]
306+
module internal TypeAbbreviations =
307+
302308
val applyTyconAbbrev: TType -> Tycon -> TypeInst -> TType
303309

304310
val reduceTyconAbbrev: Tycon -> TypeInst -> TType
@@ -309,6 +315,9 @@ module internal TypeConstruction =
309315

310316
val reduceTyconRefMeasureableOrProvided: TcGlobals -> TyconRef -> TypeInst -> TType
311317

318+
[<AutoOpen>]
319+
module internal TypeDecomposition =
320+
312321
val stripTyEqnsA: TcGlobals -> canShortcut: bool -> TType -> TType
313322

314323
val stripTyEqns: TcGlobals -> TType -> TType

0 commit comments

Comments
 (0)