Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda5a6ec

Browse files
authored
Merge pull requestdotnet#4728 from Microsoft/merges/master-to-dev15.8
Merge master to dev15.8
2 parents9e5e058 +bc725e7 commitda5a6ec

File tree

11 files changed

+102
-65
lines changed

11 files changed

+102
-65
lines changed

‎src/fsharp/CheckFormatStrings.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let lowestDefaultPriority = 0 (* See comment on TyparConstraint.DefaultsTo *)
2121

2222
letmkFlexibleFormatTypar m tys dflt=
2323
lettp= NewTypar(TyparKind.Type,TyparRigidity.Rigid,Typar(mkSynId m"fmt",HeadTypeStaticReq,true),false,TyparDynamicReq.Yes,[],false,false)
24-
tp.FixupConstraints[ TyparConstraint.SimpleChoice(tys,m); TyparConstraint.DefaultsTo(lowestDefaultPriority,dflt,m)]
24+
tp.SetConstraints[ TyparConstraint.SimpleChoice(tys,m); TyparConstraint.DefaultsTo(lowestDefaultPriority,dflt,m)]
2525
copyAndFixupFormatTypar m tp
2626

2727
letmkFlexibleIntFormatTypar(g:TcGlobals)m=

‎src/fsharp/ConstraintSolver.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,8 +1637,8 @@ and AddConstraint (csenv:ConstraintSolverEnv) ndeep m2 trace tp newConstraint =
16371637

16381638
// Write the constraint into the type variable
16391639
// Record a entry in the undo trace if one is provided
1640-
letorig= tp.typar_constraints
1641-
trace.Exec(fun()-> tp.typar_constraints<-newConstraints)(fun()-> tp.typar_constraints<- orig)
1640+
letorig= tp.Constraints
1641+
trace.Exec(fun()-> tp.SetConstraintsnewConstraints)(fun()-> tp.SetConstraints orig)
16421642

16431643
CompleteD)))
16441644

‎src/fsharp/IlxGen.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3435,7 +3435,7 @@ and GenGenericParam cenv eenv (tp:Typar) =
34353435
// use the CompiledName if given
34363436
// Inference variables get given an IL name "TA, TB" etc.
34373437
letnm=
3438-
match tp.typar_il_namewith
3438+
match tp.ILNamewith
34393439
| None-> tp.Name
34403440
| Some nm-> nm
34413441
// Some special rules apply when compiling Fsharp.Core.dll to avoid a proliferation of [<CompiledName>] attributes on type parameters

‎src/fsharp/SignatureConformance.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) =
147147
(errorR(Error(FSComp.SR.typrelSigImplNotCompatibleConstraintsDifferRemove(sigTypar.Name, Layout.showL(NicePrint.layoutTyparConstraint denv(sigTypar,sigTyparCx))),m));false)
148148
else
149149
true)&&
150-
(not checkingSig|| checkAttribs aenv implTypar.Attribs sigTypar.Attribs(fun attribs-> implTypar.typar_attribs<- attribs)))
150+
(not checkingSig|| checkAttribs aenv implTypar.Attribs sigTypar.Attribs(fun attribs-> implTypar.SetAttribs attribs)))
151151

152152
andcheckTypeDef(aenv:TypeEquivEnv)(implTycon:Tycon)(sigTycon:Tycon)=
153153
letm= implTycon.Range

‎src/fsharp/TastOps.fs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ and copyAndRemapAndBindTyparsFull remapAttrib tyenv tps =
287287
lettps'= copyTypars tps
288288
lettyenv={ tyenvwith tpinst= bindTypars tps(generalizeTypars tps') tyenv.tpinst}
289289
(tps, tps')||> List.iter2(fun tporig tp->
290-
tp.FixupConstraints(remapTyparConstraintsAux tyenv tporig.Constraints)
291-
tp.typar_attribs<-tporig.typar_attribs|> remapAttrib)
290+
tp.SetConstraints(remapTyparConstraintsAux tyenv tporig.Constraints)
291+
tp.SetAttribs(tporig.Attribs|> remapAttrib))
292292
tps', tyenv
293293

294294
// copies bound typars, extends tpinst
@@ -2273,7 +2273,7 @@ module PrettyTypes =
22732273
letniceTypars= List.map2 newPrettyTypar tps names
22742274
lettl,_tt= mkTyparToTyparRenaming tps niceTyparsin
22752275
letrenaming= renaming@ tl
2276-
(tps, niceTypars)||> List.iter2(fun tp tpnice-> tpnice.FixupConstraints(instTyparConstraints renaming tp.Constraints));
2276+
(tps, niceTypars)||> List.iter2(fun tp tpnice-> tpnice.SetConstraints(instTyparConstraints renaming tp.Constraints));
22772277
niceTypars, renaming
22782278

22792279
// We choose names for type parameters from 'a'..'t'
@@ -2282,7 +2282,7 @@ module PrettyTypes =
22822282
// Finally, we skip any names already in use
22832283
letNeedsPrettyTyparName(tp:Typar)=
22842284
tp.IsCompilerGenerated&&
2285-
tp.typar_il_name.IsNone&&
2285+
tp.ILName.IsNone&&
22862286
(tp.typar_id.idText= unassignedTyparName)
22872287

22882288
letPrettyTyparNames pred alreadyInUse tps=

‎src/fsharp/TastPickle.fs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ let p_typar_spec_data (x:Typar) st =
15111511
p_typar_constraints
15121512
p_xmldoc
15131513

1514-
(x.typar_id,x.typar_attribs,int64 x.typar_flags.PickledBits,x.typar_constraints,x.typar_xmldoc) st
1514+
(x.typar_id,x.Attribs,int64 x.typar_flags.PickledBits,x.Constraints,x.XmlDoc) st
15151515

15161516
letp_typar_spec(x:Typar)st=
15171517
//Disabled, workaround for bug 2721: if x.Rigidity <> TyparRigidity.Rigid then warning(Error(sprintf "p_typar_spec: typar#%d is not rigid" x.Stamp, x.Range))
@@ -1523,14 +1523,14 @@ let p_typar_specs = (p_list p_typar_spec)
15231523
letu_typar_spec_data st=
15241524
leta,c,d,e,g= u_tup5 u_ident u_attribs u_int64 u_typar_constraints u_xmldoc st
15251525
{ typar_id=a
1526-
typar_il_name=None
15271526
typar_stamp=newStamp()
1528-
typar_attribs=c
15291527
typar_flags=TyparFlags(int32 d)
1530-
typar_constraints=e
15311528
typar_solution=None
1532-
typar_xmldoc=g
1533-
typar_astype= Unchecked.defaultof<_>}
1529+
typar_astype= Unchecked.defaultof<_>
1530+
typar_opt_data=
1531+
match g, e, cwith
1532+
| XmlDoc[||],[],[]-> None
1533+
|_-> Some{ typar_il_name= None; typar_xmldoc= g; typar_constraints= e; typar_attribs= c}}
15341534

15351535
letu_typar_spec st=
15361536
u_osgn_decl st.itypars u_typar_spec_data st

‎src/fsharp/TypeChecker.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4513,7 +4513,7 @@ and TcTyparDecl cenv env (TyparDecl(synAttrs, (Typar(id, _, _) as stp))) =
45134513
let tp = NewTypar ((if hasMeasureAttr then TyparKind.Measure else TyparKind.Type), TyparRigidity.WarnIfNotRigid, stp, false, TyparDynamicReq.Yes, attrs, hasEqDepAttr, hasCompDepAttr)
45144514
match TryFindFSharpStringAttribute cenv.g cenv.g.attrib_CompiledNameAttribute attrs with
45154515
| Some compiledName ->
4516-
tp.typar_il_name <-Some compiledName
4516+
tp.SetILName (Some compiledName)
45174517
| None ->
45184518
()
45194519
let item = Item.TypeVar(id.idText, tp)
@@ -4940,7 +4940,7 @@ and TcTypeApp cenv newOk checkCxs occ env tpenv m tcref pathTypeArgs (synArgTys:
49404940

49414941
// If we're not checking constraints, i.e. when we first assert the super/interfaces of a type definition, then just
49424942
// clear the constraint lists of the freshly generated type variables. A little ugly but fairly localized.
4943-
if checkCxs = NoCheckCxs then tps |> List.iter (fun tp -> tp.typar_constraints <- [])
4943+
if checkCxs = NoCheckCxs then tps |> List.iter (fun tp -> tp.SetConstraints [])
49444944
if tinst.Length <> pathTypeArgs.Length + synArgTys.Length then
49454945
error (TyconBadArgs(env.DisplayEnv, tcref, pathTypeArgs.Length + synArgTys.Length, m))
49464946

‎src/fsharp/import.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ let ImportILGenericParameters amap m scoref tinst (gps: ILGenericParameterDefs)
407407
letconstraints=if gp.HasReferenceTypeConstraintthen(TyparConstraint.IsReferenceType(m)::constraints)else constraints
408408
letconstraints=if gp.HasNotNullableValueTypeConstraintthen(TyparConstraint.IsNonNullableStruct(m)::constraints)else constraints
409409
letconstraints=if gp.HasDefaultConstructorConstraintthen(TyparConstraint.RequiresDefaultConstructor(m)::constraints)else constraints
410-
tp.FixupConstraints constraints)
410+
tp.SetConstraints constraints)
411411
tps
412412

413413

‎src/fsharp/infos.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ let FixupNewTypars m (formalEnclosingTypars:Typars) (tinst: TType list) (tpsorig
345345
// The real code..
346346
letrenaming,tptys= mkTyparToTyparRenaming tpsorig tps
347347
lettprefInst= mkTyparInst formalEnclosingTypars tinst@ renaming
348-
(tpsorig,tps)||> List.iter2(fun tporig tp-> tp.FixupConstraints(CopyTyparConstraints m tprefInst tporig))
348+
(tpsorig,tps)||> List.iter2(fun tporig tp-> tp.SetConstraints(CopyTyparConstraints m tprefInst tporig))
349349
renaming,tptys
350350

351351

‎src/fsharp/symbols/Symbols.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,7 @@ and FSharpGenericParameter(cenv, v:Typar) =
10671067
member__.IsCompilerGenerated= v.IsCompilerGenerated
10681068

10691069
member__.IsMeasure=(v.Kind= TyparKind.Measure)
1070-
1071-
member__.XmlDoc= v.typar_xmldoc|> makeXmlDoc
1070+
member__.XmlDoc= v.XmlDoc|> makeXmlDoc
10721071

10731072
member__.IsSolveAtCompileTime=(v.StaticReq= TyparStaticReq.HeadTypeStaticReq)
10741073

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp