Skip to content

Commit ad91f8b

Browse files
committed
Merge remote-tracking branch 'origin/main' into otel
2 parents 03f6760 + d59a2f4 commit ad91f8b

File tree

56 files changed

+1799
-598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1799
-598
lines changed

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
</Dependency>
99
</ProductDependencies>
1010
<ToolsetDependencies>
11-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.22503.1">
11+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.22512.1">
1212
<Uri>https://github.com/dotnet/arcade</Uri>
13-
<Sha>d2d39276af2db3da7816ee2dc543e120d7e5781e</Sha>
13+
<Sha>508fe921a748de6efc8b5d979e17beb88ccf5bcf</Sha>
1414
<SourceBuild RepoName="arcade" ManagedOnly="true" />
1515
</Dependency>
16-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.22503.1">
16+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.22512.1">
1717
<Uri>https://github.com/dotnet/arcade</Uri>
18-
<Sha>d2d39276af2db3da7816ee2dc543e120d7e5781e</Sha>
18+
<Sha>508fe921a748de6efc8b5d979e17beb88ccf5bcf</Sha>
1919
</Dependency>
2020
</ToolsetDependencies>
2121
</Dependencies>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<FSharpCompilerServiceReleaseNotesVersion>$(FCSMajorVersion)$(FCSMinorVersion)$(FCSBuildVersion)</FSharpCompilerServiceReleaseNotesVersion>
4141
<!-- -->
4242
<!-- The current published nuget package -->
43-
<FSharpCoreShippedPackageVersionValue>6.0.5</FSharpCoreShippedPackageVersionValue>
43+
<FSharpCoreShippedPackageVersionValue>6.0.6</FSharpCoreShippedPackageVersionValue>
4444
<!-- -->
4545
<!-- The pattern for specifying the preview package -->
4646
<FSharpCorePreviewPackageVersionValue>$(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).*</FSharpCorePreviewPackageVersionValue>

eng/common/templates/job/onelocbuild.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ parameters:
2222
MirrorRepo: ''
2323
MirrorBranch: main
2424
condition: ''
25+
JobNameSuffix: ''
2526

2627
jobs:
27-
- job: OneLocBuild
28+
- job: OneLocBuild${{ parameters.JobNameSuffix }}
2829

2930
dependsOn: ${{ parameters.dependsOn }}
3031

31-
displayName: OneLocBuild
32+
displayName: OneLocBuild${{ parameters.JobNameSuffix }}
3233

3334
${{ if ne(parameters.pool, '') }}:
3435
pool: ${{ parameters.pool }}

eng/common/templates/jobs/source-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parameters:
1414
# This is the default platform provided by Arcade, intended for use by a managed-only repo.
1515
defaultManagedPlatform:
1616
name: 'Managed'
17-
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8-latest'
17+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8'
1818

1919
# Defines the platforms on which to run build jobs. One job is created for each platform, and the
2020
# object in this array is sent to the job template as 'platform'. If no platforms are specified,

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"perl": "5.32.1.1"
1919
},
2020
"msbuild-sdks": {
21-
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22503.1",
22-
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22503.1"
21+
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22512.1",
22+
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22512.1"
2323
}
2424
}

src/Compiler/Checking/AugmentWithHashCompare.fs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ open Internal.Utilities.Library
77
open FSharp.Compiler.AbstractIL.IL
88
open FSharp.Compiler.DiagnosticsLogger
99
open FSharp.Compiler.Syntax
10-
open FSharp.Compiler.SyntaxTrivia
1110
open FSharp.Compiler.Xml
1211
open FSharp.Compiler.TcGlobals
1312
open FSharp.Compiler.TypedTree
@@ -856,8 +855,7 @@ let slotImplMethod (final, c, slotsig) : ValMemberInfo =
856855
IsFinal=final
857856
IsOverrideOrExplicitImpl=true
858857
GetterOrSetterIsCompilerGenerated=false
859-
MemberKind=SynMemberKind.Member
860-
Trivia=SynMemberFlagsTrivia.Zero}
858+
MemberKind=SynMemberKind.Member }
861859
IsImplemented=false
862860
ApparentEnclosingEntity=c}
863861

@@ -868,8 +866,7 @@ let nonVirtualMethod c : ValMemberInfo =
868866
IsFinal=false
869867
IsOverrideOrExplicitImpl=false
870868
GetterOrSetterIsCompilerGenerated=false
871-
MemberKind=SynMemberKind.Member
872-
Trivia=SynMemberFlagsTrivia.Zero}
869+
MemberKind=SynMemberKind.Member }
873870
IsImplemented=false
874871
ApparentEnclosingEntity=c}
875872

src/Compiler/Checking/CheckDeclarations.fs

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,22 @@ let CheckDuplicates (idf: _ -> Ident) k elems =
396396
errorR (Duplicate(k, id1.idText, id1.idRange))))
397397
elems
398398

399-
399+
let private CheckDuplicatesArgNames (synVal: SynValSig) m =
400+
let argNames = synVal.SynInfo.ArgNames |> List.duplicates
401+
for name in argNames do
402+
errorR(Error((FSComp.SR.chkDuplicatedMethodParameter(name), m)))
403+
404+
let private CheckDuplicatesAbstractMethodParmsSig (typeSpecs: SynTypeDefnSig list) =
405+
for SynTypeDefnSig(typeRepr= trepr) in typeSpecs do
406+
match trepr with
407+
| SynTypeDefnSigRepr.ObjectModel(_, synMemberSigs, _) ->
408+
for sms in synMemberSigs do
409+
match sms with
410+
| SynMemberSig.Member(synValSig, _, m) ->
411+
CheckDuplicatesArgNames synValSig m
412+
| _ -> ()
413+
| _ -> ()
414+
400415
module TcRecdUnionAndEnumDeclarations =
401416

402417
let CombineReprAccess parent vis =
@@ -438,13 +453,13 @@ module TcRecdUnionAndEnumDeclarations =
438453
| _ -> ()
439454
rfspec
440455

441-
let TcAnonFieldDecl cenv env parent tpenv nm (SynField(Attributes attribs, isStatic, idOpt, ty, isMutable, xmldoc, vis, m)) =
456+
let TcAnonFieldDecl cenv env parent tpenv nm (SynField(Attributes attribs, isStatic, idOpt, ty, isMutable, xmldoc, vis, m, _)) =
442457
let mName = m.MakeSynthetic()
443458
let id = match idOpt with None -> mkSynId mName nm | Some id -> id
444459
let xmlDoc = xmldoc.ToXmlDoc(true, Some [])
445460
TcFieldDecl cenv env parent false tpenv (isStatic, attribs, id, idOpt.IsNone, ty, isMutable, xmlDoc, vis, m)
446461

447-
let TcNamedFieldDecl cenv env parent isIncrClass tpenv (SynField(Attributes attribs, isStatic, id, ty, isMutable, xmldoc, vis, m)) =
462+
let TcNamedFieldDecl cenv env parent isIncrClass tpenv (SynField(Attributes attribs, isStatic, id, ty, isMutable, xmldoc, vis, m, _)) =
448463
match id with
449464
| None -> error (Error(FSComp.SR.tcFieldRequiresName(), m))
450465
| Some id ->
@@ -480,10 +495,10 @@ module TcRecdUnionAndEnumDeclarations =
480495
match seen.TryGetValue f.LogicalName with
481496
| true, synField ->
482497
match sf, synField with
483-
| SynField(_, _, Some id, _, _, _, _, _), SynField(_, _, Some _, _, _, _, _, _) ->
498+
| SynField(idOpt = Some id), SynField(idOpt = Some _) ->
484499
error(Error(FSComp.SR.tcFieldNameIsUsedModeThanOnce(id.idText), id.idRange))
485-
| SynField(_, _, Some id, _, _, _, _, _), SynField(_, _, None, _, _, _, _, _)
486-
| SynField(_, _, None, _, _, _, _, _), SynField(_, _, Some id, _, _, _, _, _) ->
500+
| SynField(idOpt = Some id), SynField(idOpt = None)
501+
| SynField(idOpt = None), SynField(idOpt = Some id) ->
487502
error(Error(FSComp.SR.tcFieldNameConflictsWithGeneratedNameForAnonymousField(id.idText), id.idRange))
488503
| _ -> assert false
489504
| _ ->
@@ -2363,7 +2378,7 @@ module EstablishTypeDefinitionCores =
23632378
for SynUnionCase (caseType=args; range=m) in unionCases do
23642379
match args with
23652380
| SynUnionCaseKind.Fields flds ->
2366-
for SynField(_, _, _, ty, _, _, _, m) in flds do
2381+
for SynField(fieldType = ty; range = m) in flds do
23672382
let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty
23682383
yield (tyR, m)
23692384

@@ -2380,7 +2395,7 @@ module EstablishTypeDefinitionCores =
23802395

23812396
| SynTypeDefnSimpleRepr.General (_, _, _, fields, _, _, implicitCtorSynPats, _) when tycon.IsFSharpStructOrEnumTycon -> // for structs
23822397
for field in fields do
2383-
let (SynField(_, isStatic, _, ty, _, _, _, m)) = field
2398+
let (SynField(isStatic = isStatic; fieldType = ty; range = m)) = field
23842399
if not isStatic then
23852400
let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty
23862401
yield (tyR, m)
@@ -2400,7 +2415,7 @@ module EstablishTypeDefinitionCores =
24002415
yield (ty, m)
24012416

24022417
| SynTypeDefnSimpleRepr.Record (_, fields, _) ->
2403-
for SynField(_, _, _, ty, _, _, _, m) in fields do
2418+
for SynField(fieldType = ty; range = m) in fields do
24042419
let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty
24052420
yield (tyR, m)
24062421

@@ -3947,6 +3962,14 @@ module TcDeclarations =
39473962
| SynMemberDefn.NestedType (range=m) :: _ -> errorR(Error(FSComp.SR.tcTypesCannotContainNestedTypes(), m))
39483963
| _ -> ()
39493964
| ds ->
3965+
// Check for duplicated parameters in abstract methods
3966+
for slot in ds do
3967+
if isAbstractSlot slot then
3968+
match slot with
3969+
| SynMemberDefn.AbstractSlot (synVal, _, m) ->
3970+
CheckDuplicatesArgNames synVal m
3971+
| _ -> ()
3972+
39503973
// Classic class construction
39513974
let _, ds = List.takeUntil (allFalse [isMember;isAbstractSlot;isInterface;isInherit;isField;isTycon]) ds
39523975
match ds with
@@ -3976,7 +3999,7 @@ module TcDeclarations =
39763999
| SynTypeDefnRepr.ObjectModel(kind, cspec, m) ->
39774000
let cspec = desugarGetSetMembers cspec
39784001
CheckMembersForm cspec
3979-
let fields = cspec |> List.choose (function SynMemberDefn.ValField (f, _) -> Some f | _ -> None)
4002+
let fields = cspec |> List.choose (function SynMemberDefn.ValField (fieldInfo = f) -> Some f | _ -> None)
39804003
let implements2 = cspec |> List.choose (function SynMemberDefn.Interface (interfaceType=ty) -> Some(ty, ty.Range) | _ -> None)
39814004
let inherits =
39824005
cspec |> List.choose (function
@@ -4034,7 +4057,7 @@ module TcDeclarations =
40344057
// Convert auto properties to member bindings in the post-list
40354058
let rec postAutoProps memb =
40364059
match memb with
4037-
| SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; memberFlagsForSet=memberFlagsForSet; xmlDoc=xmlDoc; accessibility=access; getSetRange=mGetSetOpt) ->
4060+
| SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; memberFlagsForSet=memberFlagsForSet; xmlDoc=xmlDoc; accessibility=access; trivia = { GetSetKeyword = mGetSetOpt }) ->
40384061
let mMemberPortion = id.idRange
40394062
// Only the keep the non-field-targeted attributes
40404063
let attribs = attribs |> List.filter (fun a -> match a.Target with Some t when t.idText = "field" -> false | _ -> true)
@@ -4352,7 +4375,8 @@ let rec TcSignatureElementNonMutRec (cenv: cenv) parent typeNames endm (env: TcE
43524375
let _, _, _, env = TcExceptionDeclarations.TcExnSignature cenv env parent emptyUnscopedTyparEnv (edef, scopem)
43534376
return env
43544377

4355-
| SynModuleSigDecl.Types (typeSpecs, m) ->
4378+
| SynModuleSigDecl.Types (typeSpecs, m) ->
4379+
CheckDuplicatesAbstractMethodParmsSig typeSpecs
43564380
let scopem = unionRanges m endm
43574381
let mutRecDefns = typeSpecs |> List.map MutRecShape.Tycon
43584382
let env = TcDeclarations.TcMutRecSignatureDecls cenv env parent typeNames emptyUnscopedTyparEnv m scopem None mutRecDefns
@@ -4522,7 +4546,8 @@ and TcSignatureElementsMutRec cenv parent typeNames m mutRecNSInfo envInitial (d
45224546
let rec loop isNamespace moduleRange defs: MutRecSigsInitialData =
45234547
((true, true), defs) ||> List.collectFold (fun (openOk, moduleAbbrevOk) def ->
45244548
match def with
4525-
| SynModuleSigDecl.Types (typeSpecs, _) ->
4549+
| SynModuleSigDecl.Types (typeSpecs, _) ->
4550+
CheckDuplicatesAbstractMethodParmsSig typeSpecs
45264551
let decls = typeSpecs |> List.map MutRecShape.Tycon
45274552
decls, (false, false)
45284553

src/Compiler/Checking/CheckExpressions.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6705,7 +6705,7 @@ and TcObjectExprBinding (cenv: cenv) (env: TcEnv) implTy tpenv (absSlotInfo, bin
67056705
| SynPat.Named (SynIdent(id,_), _, _, _), None ->
67066706
let bindingRhs = PushOnePatternToRhs cenv true (mkSynThisPatVar (ident (CompilerGeneratedName "this", id.idRange))) bindingRhs
67076707
let logicalMethId = id
6708-
let memberFlags = OverrideMemberFlags SynMemberFlagsTrivia.Zero SynMemberKind.Member
6708+
let memberFlags = OverrideMemberFlags SynMemberKind.Member
67096709
bindingRhs, logicalMethId, memberFlags
67106710

67116711
| SynPat.InstanceMember(thisId, memberId, _, _, _), Some memberFlags ->
@@ -8579,7 +8579,7 @@ and TcImplicitOpItemThen (cenv: cenv) overallTy env id sln tpenv mItem delayed =
85798579

85808580
let vs, ves = argTys |> List.mapi (fun i ty -> mkCompGenLocal mItem ("arg" + string i) ty) |> List.unzip
85818581

8582-
let memberFlags = StaticMemberFlags SynMemberFlagsTrivia.Zero SynMemberKind.Member
8582+
let memberFlags = StaticMemberFlags SynMemberKind.Member
85838583
let logicalCompiledName = ComputeLogicalName id memberFlags
85848584
let traitInfo = TTrait(argTys, logicalCompiledName, memberFlags, argTys, Some retTy, sln)
85858585

src/Compiler/Checking/CheckIncrementalClasses.fs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ open FSharp.Compiler.CompilerGlobalState
1414
open FSharp.Compiler.DiagnosticsLogger
1515
open FSharp.Compiler.NameResolution
1616
open FSharp.Compiler.Syntax
17-
open FSharp.Compiler.SyntaxTrivia
1817
open FSharp.Compiler.SyntaxTreeOps
1918
open FSharp.Compiler.Text
2019
open FSharp.Compiler.Xml
@@ -122,7 +121,7 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr
122121

123122
// NOTE: no attributes can currently be specified for the implicit constructor
124123
let attribs = TcAttributes cenv env (AttributeTargets.Constructor ||| AttributeTargets.Method) attrs
125-
let memberFlags = CtorMemberFlags SynMemberFlagsTrivia.Zero
124+
let memberFlags = CtorMemberFlags
126125

127126
let synArgInfos = List.map (SynInfo.InferSynArgInfoFromSimplePat []) spats
128127
let valSynData = SynValInfo([synArgInfos], SynInfo.unnamedRetVal)
@@ -150,8 +149,8 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr
150149
let cctorTy = mkFunTy g g.unit_ty g.unit_ty
151150
let valSynData = SynValInfo([[]], SynInfo.unnamedRetVal)
152151
let id = ident ("cctor", m)
153-
CheckForNonAbstractInterface ModuleOrMemberBinding tcref (ClassCtorMemberFlags SynMemberFlagsTrivia.Zero) id.idRange
154-
let memberInfo = MakeMemberDataAndMangledNameForMemberVal(g, tcref, false, [], [], (ClassCtorMemberFlags SynMemberFlagsTrivia.Zero), valSynData, id, false)
152+
CheckForNonAbstractInterface ModuleOrMemberBinding tcref ClassCtorMemberFlags id.idRange
153+
let memberInfo = MakeMemberDataAndMangledNameForMemberVal(g, tcref, false, [], [], ClassCtorMemberFlags, valSynData, id, false)
155154
let prelimValReprInfo = TranslateSynValInfo m (TcAttributes cenv env) valSynData
156155
let prelimTyschemeG = GeneralizedType(copyOfTyconTypars, cctorTy)
157156
let valReprInfo = InferGenericArityFromTyScheme prelimTyschemeG prelimValReprInfo
@@ -323,7 +322,7 @@ type IncrClassReprInfo =
323322
let tps, _, argInfos, _, _ = GetValReprTypeInCompiledForm g valReprInfo 0 v.Type v.Range
324323

325324
let valSynInfo = SynValInfo(argInfos |> List.mapSquared (fun (_, argInfo) -> SynArgInfo([], false, argInfo.Name)), SynInfo.unnamedRetVal)
326-
let memberFlags = (if isStatic then StaticMemberFlags else NonVirtualMemberFlags) SynMemberFlagsTrivia.Zero SynMemberKind.Member
325+
let memberFlags = (if isStatic then StaticMemberFlags else NonVirtualMemberFlags) SynMemberKind.Member
327326
let id = mkSynId v.Range name
328327
let memberInfo = MakeMemberDataAndMangledNameForMemberVal(g, tcref, false, [], [], memberFlags, valSynInfo, mkSynId v.Range name, true)
329328

src/Compiler/FSComp.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,4 +1656,5 @@ reprStateMachineInvalidForm,"The state machine has an unexpected form"
16561656
3546,parsExpectingPatternInTuple,"Expecting pattern"
16571657
3547,parsExpectedPatternAfterToken,"Expected a pattern after this point"
16581658
3548,matchNotAllowedForUnionCaseWithNoData,"Pattern discard is not allowed for union case that takes no data."
1659-
3549,tcSynTypeOrInvalidInDeclaration,"SynType.Or is not permitted in this declaration"
1659+
3549,tcSynTypeOrInvalidInDeclaration,"SynType.Or is not permitted in this declaration"
1660+
3550,chkDuplicatedMethodParameter,"Duplicate parameter. The parameter '%s' has been used more that once in this method."

0 commit comments

Comments
 (0)