Skip to content

Commit d3bd5b1

Browse files
authored
Merge branch 'main' into 12013-type-syntax-for-5d-6d-etc-arrays
2 parents 62901e7 + 0ec7fb2 commit d3bd5b1

File tree

11 files changed

+78
-24
lines changed

11 files changed

+78
-24
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.22473.1">
11+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.22477.1">
1212
<Uri>https://github.com/dotnet/arcade</Uri>
13-
<Sha>ba4d2568dd2e3e7538feeaba60215f7bcb99e89c</Sha>
13+
<Sha>0213f8ad31ac8c63ad41760f02a929998abf69bb</Sha>
1414
<SourceBuild RepoName="arcade" ManagedOnly="true" />
1515
</Dependency>
16-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.22473.1">
16+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.22477.1">
1717
<Uri>https://github.com/dotnet/arcade</Uri>
18-
<Sha>ba4d2568dd2e3e7538feeaba60215f7bcb99e89c</Sha>
18+
<Sha>0213f8ad31ac8c63ad41760f02a929998abf69bb</Sha>
1919
</Dependency>
2020
</ToolsetDependencies>
2121
</Dependencies>

eng/common/templates/job/execute-sdl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- job: Run_SDL
3535
dependsOn: ${{ parameters.dependsOn }}
3636
displayName: Run SDL tool
37-
condition: eq( ${{ parameters.enable }}, 'true')
37+
condition: and(succeededOrFailed(), eq( ${{ parameters.enable }}, 'true'))
3838
variables:
3939
- group: DotNet-VSTS-Bot
4040
- name: AzDOProjectName

eng/common/templates/post-build/post-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ stages:
9898
jobs:
9999
- job:
100100
displayName: NuGet Validation
101-
condition: eq( ${{ parameters.enableNugetValidation }}, 'true')
101+
condition: and(succeededOrFailed(), eq( ${{ parameters.enableNugetValidation }}, 'true'))
102102
pool:
103103
# We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
104104
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
@@ -282,4 +282,4 @@ stages:
282282
-MaestroToken '$(MaestroApiAccessToken)'
283283
-WaitPublishingFinish true
284284
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
285-
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
285+
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'

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.22473.1",
22-
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22473.1"
21+
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22477.1",
22+
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22477.1"
2323
}
2424
}

src/Compiler/Checking/AttributeChecking.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ let CheckUnionCaseAttributes g (x:UnionCaseRef) m =
507507
/// Check the attributes on a record field, returning errors and warnings as data.
508508
let CheckRecdFieldAttributes g (x:RecdFieldRef) m =
509509
CheckEntityAttributes g x.TyconRef m ++ (fun () ->
510-
CheckFSharpAttributes g x.PropertyAttribs m)
510+
CheckFSharpAttributes g x.PropertyAttribs m) ++ (fun () ->
511+
CheckFSharpAttributes g x.RecdField.FieldAttribs m)
511512

512513
/// Check the attributes on an F# value, returning errors and warnings as data.
513514
let CheckValAttributes g (x:ValRef) m =

src/Compiler/Checking/CheckDeclarations.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ module TcRecdUnionAndEnumDeclarations =
545545

546546
let TcEnumDecl cenv env parent thisTy fieldTy (SynEnumCase(attributes=Attributes synAttrs; ident= SynIdent(id,_); value=v; xmlDoc=xmldoc; range=m)) =
547547
let attrs = TcAttributes cenv env AttributeTargets.Field synAttrs
548+
548549
match v with
549550
| SynConst.Bytes _
550551
| SynConst.UInt16s _

src/Compiler/Checking/PatternMatchCompilation.fs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ let GetSubExprOfInput g (gtps, tyargs, tinst) (SubExpr(accessf, (ve2, v2))) =
143143
// The ints record which choices taken, e.g. tuple/record fields.
144144
type Path =
145145
| PathQuery of Path * Unique
146-
| PathConj of Path * int
147146
| PathTuple of Path * TypeInst * int
148147
| PathRecd of Path * TyconRef * TypeInst * int
149148
| PathUnionConstr of Path * UnionCaseRef * TypeInst * int
@@ -154,7 +153,6 @@ type Path =
154153
let rec pathEq p1 p2 =
155154
match p1, p2 with
156155
| PathQuery(p1, n1), PathQuery(p2, n2) -> (n1 = n2) && pathEq p1 p2
157-
| PathConj(p1, n1), PathConj(p2, n2) -> (n1 = n2) && pathEq p1 p2
158156
| PathTuple(p1, _, n1), PathTuple(p2, _, n2) -> (n1 = n2) && pathEq p1 p2
159157
| PathRecd(p1, _, _, n1), PathRecd(p2, _, _, n2) -> (n1 = n2) && pathEq p1 p2
160158
| PathUnionConstr(p1, _, _, n1), PathUnionConstr(p2, _, _, n2) -> (n1 = n2) && pathEq p1 p2
@@ -203,8 +201,6 @@ let RefuteDiscrimSet g m path discrims =
203201
let rec go path tm =
204202
match path with
205203
| PathQuery _ -> raise CannotRefute
206-
| PathConj (p, _j) ->
207-
go p tm
208204
| PathTuple (p, tys, j) ->
209205
let k, eCoversVals = mkOneKnown tm j tys
210206
go p (fun _ -> mkRefTupled g m k tys, eCoversVals)
@@ -391,8 +387,6 @@ type Frontier = Frontier of ClauseNumber * Actives * ValMap<Expr>
391387
type InvestigationPoint = Investigation of ClauseNumber * DecisionTreeTest * Path
392388

393389
// Note: actives must be a SortedDictionary
394-
// REVIEW: improve these data structures, though surprisingly these functions don't tend to show up
395-
// on profiling runs
396390
let rec isMemOfActives p1 actives =
397391
match actives with
398392
| [] -> false
@@ -1624,7 +1618,7 @@ let CompilePatternBasic
16241618
subPats |> List.collect (fun subPat -> BindProjectionPattern (Active(inpPath, inpExpr, subPat)) activeState)
16251619

16261620
| TPat_conjs(subPats, _m) ->
1627-
let newActives = List.mapi (mkSubActive (fun path j -> PathConj(path, j)) (fun _j -> inpAccess)) subPats
1621+
let newActives = List.mapi (mkSubActive (fun path _j -> path) (fun _j -> inpAccess)) subPats
16281622
BindProjectionPatterns newActives activeState
16291623

16301624
| TPat_range (c1, c2, m) ->

tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ C.Update()
206206
|> withDiagnostics [
207207
(Error 101, Line 9, Col 1, Line 9, Col 9, "This construct is deprecated. Use B instead")
208208
]
209-
209+
210210
[<Fact>]
211-
let ``Obsolete attribute is taken into account when used on an enum and invocation`` () =
211+
let ``Obsolete attribute error is taken into account when used on an enum and invocation`` () =
212212
Fsx """
213213
open System
214214
@@ -219,15 +219,14 @@ type Color =
219219
220220
let c = Color.Red
221221
"""
222-
|> ignoreWarnings
223222
|> compile
224223
|> shouldFail
225224
|> withDiagnostics [
226225
(Error 101, Line 9, Col 9, Line 9, Col 14, "This construct is deprecated. Use B instead")
227226
]
228-
227+
229228
[<Fact>]
230-
let ``Obsolete attribute is taken into account when used on an enum entry and invocation`` () =
229+
let ``Obsolete attribute error is taken into account when used on an enum field and invocation`` () =
231230
Fsx """
232231
open System
233232
@@ -237,9 +236,28 @@ type Color =
237236
238237
let c = Color.Red
239238
"""
240-
|> ignoreWarnings
241239
|> compile
242-
|> shouldSucceed
240+
|> shouldFail
241+
|> withDiagnostics [
242+
(Error 101, Line 8, Col 9, Line 8, Col 18, "This construct is deprecated. Use B instead")
243+
]
244+
245+
[<Fact>]
246+
let ``Obsolete attribute warning is taken into account when used on an enum field and invocation`` () =
247+
Fsx """
248+
open System
249+
250+
type Color =
251+
| [<Obsolete("Use B instead")>] Red = 0
252+
| Green = 1
253+
254+
let c = Color.Red
255+
"""
256+
|> compile
257+
|> shouldFail
258+
|> withDiagnostics [
259+
(Warning 44, Line 8, Col 9, Line 8, Col 18, "This construct is deprecated. Use B instead")
260+
]
243261

244262
[<Fact>]
245263
let ``Obsolete attribute is taken into account when used on an type and use extension method`` () =

tests/fsharp/tests.fs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,6 +2586,21 @@ module TypecheckTests =
25862586
peverify cfg "pos40.exe"
25872587
exec cfg ("." ++ "pos40.exe") ""
25882588

2589+
[<Test>]
2590+
let ``sigs pos1281`` () =
2591+
let cfg = testConfig "typecheck/sigs"
2592+
// This checks that warning 25 "incomplete matches" is not triggered
2593+
fsc cfg "%s --target:exe -o:pos1281.exe --warnaserror --nowarn:26" cfg.fsc_flags ["pos1281.fs"]
2594+
peverify cfg "pos1281.exe"
2595+
exec cfg ("." ++ "pos1281.exe") ""
2596+
2597+
[<Test>]
2598+
let ``sigs pos3294`` () =
2599+
let cfg = testConfig "typecheck/sigs"
2600+
fsc cfg "%s --target:exe -o:pos3294.exe --warnaserror" cfg.fsc_flags ["pos3294.fs"]
2601+
peverify cfg "pos3294.exe"
2602+
exec cfg ("." ++ "pos3294.exe") ""
2603+
25892604
[<Test>]
25902605
let ``sigs pos23`` () =
25912606
let cfg = testConfig "typecheck/sigs"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module Pos1281
2+
3+
type Cond = Foo | Bar | Baz
4+
let (|SetV|) x _ = x
5+
6+
let c = Cond.Foo
7+
8+
match c with
9+
| Baz ->
10+
printfn "Baz"
11+
| Foo & SetV "and" kwd
12+
| Bar & SetV "or" kwd ->
13+
printfn "Keyword: %s" kwd
14+
| Baz -> failwith "wat"
15+
16+
printfn "test completed"
17+
exit 0

0 commit comments

Comments
 (0)