@@ -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
@@ -3194,7 +3193,7 @@ module EstablishTypeDefinitionCores =
31943193
31953194 let hasMeasureAttr = attribsHaveEntityFlag g WellKnownEntityAttributes.MeasureAttribute attrs
31963195 let hasMeasureableAttr = attribsHaveEntityFlag g WellKnownEntityAttributes.MeasureableAttribute attrs
3197- let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars m ) envinner
3196+ let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars) envinner
31983197 let envinner = MakeInnerEnvForTyconRef envinner thisTyconRef false
31993198
32003199 match synTyconRepr with
@@ -3205,7 +3204,7 @@ module EstablishTypeDefinitionCores =
32053204 // "type x = | A" can always be used instead.
32063205 | TyconCoreAbbrevThatIsReallyAUnion ( hasMeasureAttr, envinner, id) _ -> ()
32073206
3208- | SynTypeDefnSimpleRepr.TypeAbbrev( ParserDetail.Ok, rhsType, m ) ->
3207+ | SynTypeDefnSimpleRepr.TypeAbbrev( ParserDetail.Ok, rhsType, _ m ) ->
32093208
32103209#if ! NO_ TYPEPROVIDERS
32113210 // 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
@@ -3254,7 +3253,7 @@ module EstablishTypeDefinitionCores =
32543253
32553254 if not firstPass then
32563255 let ftyvs = freeInTypeLeftToRight g false ty
3257- let typars = tycon.Typars m
3256+ let typars = tycon.Typars
32583257 if ftyvs.Length <> typars.Length then
32593258 errorR( Deprecated( FSComp.SR.tcTypeAbbreviationHasTypeParametersMissingOnType(), tycon.Range))
32603259
@@ -3279,9 +3278,8 @@ module EstablishTypeDefinitionCores =
32793278 match origInfo, tyconAndAttrsOpt with
32803279 | ( typeDefCore, _, _), Some ( tycon, ( attrs, _)) ->
32813280 let ( MutRecDefnsPhase1DataForTycon ( _ , synTyconRepr , explicitImplements , _ , _ , _ )) = typeDefCore
3282- let m = tycon.Range
32833281 let tcref = mkLocalTyconRef tycon
3284- let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars m ) envinner
3282+ let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars) envinner
32853283 let envinner = MakeInnerEnvForTyconRef envinner tcref false
32863284
32873285 let implementedTys , _ = List.mapFold ( mapFoldFst ( TcTypeAndRecover cenv NoNewTypars checkConstraints ItemOccurrence.UseInType WarnOnIWSAM.No envinner)) tpenv explicitImplements
@@ -3442,7 +3440,7 @@ module EstablishTypeDefinitionCores =
34423440 if allowed then
34433441 if kind = explicitKind then
34443442 warning( PossibleUnverifiableCode m)
3445- elif List.isEmpty ( thisTyconRef.Typars m ) then
3443+ elif List.isEmpty ( thisTyconRef.Typars) then
34463444 errorR ( Error( FSComp.SR.tcOnlyStructsCanHaveStructLayout(), m))
34473445 else
34483446 errorR ( Error( FSComp.SR.tcGenericTypesCannotHaveStructLayout(), m))
@@ -3474,7 +3472,7 @@ module EstablishTypeDefinitionCores =
34743472 if not ctorArgNames.IsEmpty then
34753473 errorR ( Error( FSComp.SR.parsOnlyClassCanTakeValueArguments(), pat.Range))
34763474
3477- let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars m ) envinner
3475+ let envinner = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars) envinner
34783476 let envinner = MakeInnerEnvForTyconRef envinner thisTyconRef false
34793477
34803478 let multiCaseUnionStructCheck ( unionCases : UnionCase list ) =
@@ -3640,7 +3638,7 @@ module EstablishTypeDefinitionCores =
36403638 writeFakeRecordFieldsToSink userFields
36413639
36423640 let superTy = tycon.TypeContents.tcaug_ super
3643- let containerInfo = TyconContainerInfo( innerParent, thisTyconRef, thisTyconRef.Typars m , NoSafeInitInfo)
3641+ let containerInfo = TyconContainerInfo( innerParent, thisTyconRef, thisTyconRef.Typars, NoSafeInitInfo)
36443642 let kind = InferTyconKind g ( kind, attrs, slotsigs, fields, inSig, isConcrete, m)
36453643 match kind with
36463644 | SynTypeDefnKind.Opaque ->
@@ -3712,7 +3710,7 @@ module EstablishTypeDefinitionCores =
37123710 let _ , _ , curriedArgInfos , returnTy , _ = GetValReprTypeInCompiledForm g ( arity |> TranslateSynValInfo cenv m ( TcAttributes cenv envinner) |> TranslatePartialValReprInfo []) 0 tyR m
37133711 if curriedArgInfos.Length < 1 then error( Error( FSComp.SR.tcInvalidDelegateSpecification(), m))
37143712 if curriedArgInfos.Length > 1 then error( Error( FSComp.SR.tcDelegatesCannotBeCurried(), m))
3715- let ttps = thisTyconRef.Typars m
3713+ let ttps = thisTyconRef.Typars
37163714 let fparams =
37173715 curriedArgInfos.Head
37183716 |> List.map ( fun ( ty , argInfo : ArgReprInfo ) ->
@@ -4028,7 +4026,7 @@ module EstablishTypeDefinitionCores =
40284026 let ( MutRecDefnsPhase1DataForTycon ( synTyconInfo , _ , _ , _ , _ , _ )) = typeDefCore
40294027 let ( SynComponentInfo ( _ , TyparsAndConstraints ( _ , cs1 ), cs2 , _ , _ , _ , _ , _ )) = synTyconInfo
40304028 let synTyconConstraints = cs1 @ cs2
4031- let envForTycon = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars m ) envForDecls
4029+ let envForTycon = AddDeclaredTypars CheckForDuplicateTypars ( tycon.Typars) envForDecls
40324030 let thisTyconRef = mkLocalTyconRef tycon
40334031 let envForTycon = MakeInnerEnvForTyconRef envForTycon thisTyconRef false
40344032 try
@@ -4143,7 +4141,7 @@ module EstablishTypeDefinitionCores =
41434141
41444142 // No inferred constraints allowed on declared typars
41454143 ( envMutRecPrelim, withEnvs) ||> MutRecShapes.iterTyconsWithEnv ( fun envForDecls ( _ , tyconOpt ) ->
4146- tyconOpt |> Option.iter ( fun tycon -> tycon.Typars m |> List.iter ( SetTyparRigid envForDecls.DisplayEnv m)))
4144+ tyconOpt |> Option.iter ( fun tycon -> tycon.Typars |> List.iter ( SetTyparRigid envForDecls.DisplayEnv m)))
41474145
41484146 // Phase1E. OK, now recheck the abbreviations, super/interface and explicit constraints types (this time checking constraints)
41494147 ( envMutRecPrelim, withAttrs) ||> MutRecShapes.iterTyconsWithEnv ( fun envForDecls ( origInfo , tyconAndAttrsOpt ) ->
@@ -4246,7 +4244,7 @@ module TcDeclarations =
42464244 tcref.Deref.IsFSharpDelegateTycon ||
42474245 tcref.Deref.IsFSharpEnumTycon
42484246
4249- let reqTypars = tcref.Typars m
4247+ let reqTypars = tcref.Typars
42504248
42514249 // Member definitions are intrinsic (added directly to the type) if:
42524250 // a) For interfaces, only if it is in the original defn.
0 commit comments