@@ -1701,7 +1701,7 @@ module MutRecBindingChecking =
17011701 let thisValOpt = GetInstanceMemberThisVariable ( v, x)
17021702
17031703 // Members have at least as many type parameters as the enclosing class. Just grab the type variables for the type.
1704- let thisTyInst = List.map mkTyparTy ( List.truncate ( tcref.Typars( v.Range ) .Length) v.Typars)
1704+ let thisTyInst = List.map mkTyparTy ( List.truncate ( tcref.Typars.Length) v.Typars)
17051705
17061706 let x = localReps.FixupIncrClassExprPhase2C cenv thisValOpt safeStaticInitInfo thisTyInst x
17071707
@@ -2153,7 +2153,7 @@ module TyconConstraintInference =
21532153 | ValueSome tp ->
21542154 // Within structural types, type parameters can be optimistically assumed to have comparison
21552155 // We record the ones for which we have made this assumption.
2156- if tycon.TyparsNoRange |> List.exists ( fun tp2 -> typarRefEq tp tp2) then
2156+ if tycon.Typars |> List.exists ( fun tp2 -> typarRefEq tp tp2) then
21572157 assumedTyparsAcc <- assumedTyparsAcc.Add( tp.Stamp)
21582158 true
21592159 else
@@ -2180,7 +2180,7 @@ module TyconConstraintInference =
21802180 not ( EntityHasWellKnownAttribute g WellKnownEntityAttributes.NoComparisonAttribute tcref.Deref)
21812181 &&
21822182 // Check the structural dependencies
2183- ( tinst, tcref.TyparsNoRange ) ||> List.lengthsEqAndForall2 ( fun ty tp ->
2183+ ( tinst, tcref.Typars ) ||> List.lengthsEqAndForall2 ( fun ty tp ->
21842184 if tp.ComparisonConditionalOn || assumedTypars.Contains tp.Stamp then
21852185 checkIfFieldTypeSupportsComparison tycon ty
21862186 else
@@ -2239,7 +2239,7 @@ module TyconConstraintInference =
22392239 // OK, we're done, Record the results for the type variable which provide the support
22402240 for tyconStamp in uneliminatedTycons do
22412241 let tycon , _ = tab[ tyconStamp]
2242- for tp in tycon.Typars( tycon.Range ) do
2242+ for tp in tycon.Typars do
22432243 if assumedTyparsActual.Contains( tp.Stamp) then
22442244 tp.SetComparisonDependsOn true
22452245
@@ -2274,7 +2274,7 @@ module TyconConstraintInference =
22742274 | ValueSome tp ->
22752275 // Within structural types, type parameters can be optimistically assumed to have equality
22762276 // We record the ones for which we have made this assumption.
2277- if tycon.Typars( tycon.Range ) |> List.exists ( fun tp2 -> typarRefEq tp tp2) then
2277+ if tycon.Typars |> List.exists ( fun tp2 -> typarRefEq tp tp2) then
22782278 assumedTyparsAcc <- assumedTyparsAcc.Add( tp.Stamp)
22792279 true
22802280 else
@@ -2300,7 +2300,7 @@ module TyconConstraintInference =
23002300 not ( EntityHasWellKnownAttribute g WellKnownEntityAttributes.NoEqualityAttribute tcref.Deref)
23012301 &&
23022302 // Check the structural dependencies
2303- ( tinst, tcref.TyparsNoRange ) ||> List.lengthsEqAndForall2 ( fun ty tp ->
2303+ ( tinst, tcref.Typars ) ||> List.lengthsEqAndForall2 ( fun ty tp ->
23042304 if tp.EqualityConditionalOn || assumedTypars.Contains tp.Stamp then
23052305 checkIfFieldTypeSupportsEquality tycon ty
23062306 else
@@ -2360,7 +2360,7 @@ module TyconConstraintInference =
23602360 // OK, we're done, Record the results for the type variable which provide the support
23612361 for tyconStamp in uneliminatedTycons do
23622362 let tycon , _ = tab[ tyconStamp]
2363- for tp in tycon.Typars( tycon.Range ) do
2363+ for tp in tycon.Typars do
23642364 if assumedTyparsActual.Contains( tp.Stamp) then
23652365 tp.SetEqualityDependsOn true
23662366
@@ -2604,8 +2604,7 @@ module EstablishTypeDefinitionCores =
26042604 let private GetStructuralElementsOfTyconDefn ( cenv : cenv ) env tpenv ( MutRecDefnsPhase1DataForTycon ( _ , synTyconRepr , _ , _ , _ , _ )) tycon =
26052605 let thisTyconRef = mkLocalTyconRef tycon
26062606 let g = cenv.g
2607- let m = tycon.Range
2608- let env = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars m) env
2607+ let env = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars) env
26092608 let env = MakeInnerEnvForTyconRef env thisTyconRef false
26102609 [ match synTyconRepr with
26112610 | SynTypeDefnSimpleRepr.None _ -> ()
@@ -2646,7 +2645,7 @@ module EstablishTypeDefinitionCores =
26462645 for arg in ctorArgNames do
26472646 let ty = names[ arg]. Type
26482647 let m = names[ arg]. Ident.idRange
2649- if not ( isNil ( ListSet.subtract typarEq ( freeInTypeLeftToRight g false ty) tycon.TyparsNoRange )) then
2648+ if not ( isNil ( ListSet.subtract typarEq ( freeInTypeLeftToRight g false ty) tycon.Typars )) then
26502649 errorR( Error( FSComp.SR.tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly(), m))
26512650 yield ( ty, m)
26522651
@@ -3215,7 +3214,7 @@ module EstablishTypeDefinitionCores =
32153214
32163215 let hasMeasureAttr = attribsHaveEntityFlag g WellKnownEntityAttributes.MeasureAttribute attrs
32173216 let hasMeasureableAttr = attribsHaveEntityFlag g WellKnownEntityAttributes.MeasureableAttribute attrs
3218- let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars m ) envinner
3217+ let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars) envinner
32193218 let envinner = MakeInnerEnvForTyconRef envinner thisTyconRef false
32203219
32213220 match synTyconRepr with
@@ -3226,7 +3225,7 @@ module EstablishTypeDefinitionCores =
32263225 // "type x = | A" can always be used instead.
32273226 | TyconCoreAbbrevThatIsReallyAUnion ( hasMeasureAttr, envinner, id) _ -> ()
32283227
3229- | SynTypeDefnSimpleRepr.TypeAbbrev( ParserDetail.Ok, rhsType, m ) ->
3228+ | SynTypeDefnSimpleRepr.TypeAbbrev( ParserDetail.Ok, rhsType, _ m ) ->
32303229
32313230#if ! NO_ TYPEPROVIDERS
32323231 // Check we have not already decided that this is a generative provided type definition. If we have already done this (i.e. this is the second pass
@@ -3275,7 +3274,7 @@ module EstablishTypeDefinitionCores =
32753274
32763275 if not firstPass then
32773276 let ftyvs = freeInTypeLeftToRight g false ty
3278- let typars = tycon.Typars m
3277+ let typars = tycon.Typars
32793278 if ftyvs.Length <> typars.Length then
32803279 errorR( Deprecated( FSComp.SR.tcTypeAbbreviationHasTypeParametersMissingOnType(), tycon.Range))
32813280
@@ -3300,9 +3299,8 @@ module EstablishTypeDefinitionCores =
33003299 match origInfo, tyconAndAttrsOpt with
33013300 | ( typeDefCore, _, _), Some ( tycon, ( attrs, _)) ->
33023301 let ( MutRecDefnsPhase1DataForTycon ( _ , synTyconRepr , explicitImplements , _ , _ , _ )) = typeDefCore
3303- let m = tycon.Range
33043302 let tcref = mkLocalTyconRef tycon
3305- let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars m ) envinner
3303+ let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars) envinner
33063304 let envinner = MakeInnerEnvForTyconRef envinner tcref false
33073305
33083306 let implementedTys , _ = List.mapFold ( mapFoldFst ( TcTypeAndRecover cenv NoNewTypars checkConstraints ItemOccurrence.UseInType WarnOnIWSAM.No envinner)) tpenv explicitImplements
@@ -3463,7 +3461,7 @@ module EstablishTypeDefinitionCores =
34633461 if allowed then
34643462 if kind = explicitKind then
34653463 warning( PossibleUnverifiableCode m)
3466- elif List.isEmpty ( thisTyconRef.Typars m ) then
3464+ elif List.isEmpty ( thisTyconRef.Typars) then
34673465 errorR ( Error( FSComp.SR.tcOnlyStructsCanHaveStructLayout(), m))
34683466 else
34693467 errorR ( Error( FSComp.SR.tcGenericTypesCannotHaveStructLayout(), m))
@@ -3495,7 +3493,7 @@ module EstablishTypeDefinitionCores =
34953493 if not ctorArgNames.IsEmpty then
34963494 errorR ( Error( FSComp.SR.parsOnlyClassCanTakeValueArguments(), pat.Range))
34973495
3498- let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars m ) envinner
3496+ let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars) envinner
34993497 let envinner = MakeInnerEnvForTyconRef envinner thisTyconRef false
35003498
35013499 let multiCaseUnionStructCheck ( unionCases : UnionCase list ) =
@@ -3661,7 +3659,7 @@ module EstablishTypeDefinitionCores =
36613659 writeFakeRecordFieldsToSink userFields
36623660
36633661 let superTy = tycon.TypeContents.tcaug_ super
3664- let containerInfo = TyconContainerInfo( innerParent, thisTyconRef, thisTyconRef.Typars m , NoSafeInitInfo)
3662+ let containerInfo = TyconContainerInfo( innerParent, thisTyconRef, thisTyconRef.Typars, NoSafeInitInfo)
36653663 let kind = InferTyconKind g ( kind, attrs, slotsigs, fields, inSig, isConcrete, m)
36663664 match kind with
36673665 | SynTypeDefnKind.Opaque ->
@@ -3733,7 +3731,7 @@ module EstablishTypeDefinitionCores =
37333731 let _ , _ , curriedArgInfos , returnTy , _ = GetValReprTypeInCompiledForm g ( arity |> TranslateSynValInfo cenv m ( TcAttributes cenv envinner) |> TranslatePartialValReprInfo []) 0 tyR m
37343732 if curriedArgInfos.Length < 1 then error( Error( FSComp.SR.tcInvalidDelegateSpecification(), m))
37353733 if curriedArgInfos.Length > 1 then error( Error( FSComp.SR.tcDelegatesCannotBeCurried(), m))
3736- let ttps = thisTyconRef.Typars m
3734+ let ttps = thisTyconRef.Typars
37373735 let fparams =
37383736 curriedArgInfos.Head
37393737 |> List.map ( fun ( ty , argInfo : ArgReprInfo ) ->
@@ -4049,7 +4047,7 @@ module EstablishTypeDefinitionCores =
40494047 let ( MutRecDefnsPhase1DataForTycon ( synTyconInfo , _ , _ , _ , _ , _ )) = typeDefCore
40504048 let ( SynComponentInfo ( _ , TyparsAndConstraints ( _ , cs1 ), cs2 , _ , _ , _ , _ , _ )) = synTyconInfo
40514049 let synTyconConstraints = cs1 @ cs2
4052- let envForTycon = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars m ) envForDecls
4050+ let envForTycon = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars) envForDecls
40534051 let thisTyconRef = mkLocalTyconRef tycon
40544052 let envForTycon = MakeInnerEnvForTyconRef envForTycon thisTyconRef false
40554053 try
@@ -4170,7 +4168,7 @@ module EstablishTypeDefinitionCores =
41704168
41714169 // No inferred constraints allowed on declared typars
41724170 ( envMutRecPrelim, withEnvs) ||> MutRecShapes.iterTyconsWithEnv ( fun envForDecls ( _ , tyconOpt ) ->
4173- tyconOpt |> Option.iter ( fun tycon -> tycon.Typars m |> List.iter ( SetTyparRigid envForDecls.DisplayEnv m)))
4171+ tyconOpt |> Option.iter ( fun tycon -> tycon.Typars |> List.iter ( SetTyparRigid envForDecls.DisplayEnv m)))
41744172
41754173 // Phase1E. OK, now recheck the abbreviations, super/interface and explicit constraints types (this time checking constraints)
41764174 ( envMutRecPrelim, withAttrs) ||> MutRecShapes.iterTyconsWithEnv ( fun envForDecls ( origInfo , tyconAndAttrsOpt ) ->
@@ -4273,7 +4271,7 @@ module TcDeclarations =
42734271 tcref.Deref.IsFSharpDelegateTycon ||
42744272 tcref.Deref.IsFSharpEnumTycon
42754273
4276- let reqTypars = tcref.Typars m
4274+ let reqTypars = tcref.Typars
42774275
42784276 // Member definitions are intrinsic (added directly to the type) if:
42794277 // a) For interfaces, only if it is in the original defn.
0 commit comments