Skip to content

Commit 4b0235c

Browse files
authored
Merge pull request #9343 from dotnet/merges/master-to-feature/witness-passing
Merge master to feature/witness-passing
2 parents 48512f1 + 4f0d6bf commit 4b0235c

File tree

13 files changed

+66
-45
lines changed

13 files changed

+66
-45
lines changed

benchmarks/CompilerServiceBenchmarks/Program.fs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ type CompilerService() =
146146
let readerOptions =
147147
{
148148
pdbDirPath = None
149-
ilGlobals = mkILGlobals ILScopeRef.Local
150149
reduceMemoryUsage = ReduceMemoryFlag.No
151150
metadataOnly = MetadataOnlyFlag.Yes
152151
tryGetMetadataSnapshot = fun _ -> None

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<ProductDependencies>
44
</ProductDependencies>
55
<ToolsetDependencies>
6-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.20269.3">
6+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.20278.5">
77
<Uri>https://github.com/dotnet/arcade</Uri>
8-
<Sha>ccfddb60fbd3de13463298334f00610edb5f63c6</Sha>
8+
<Sha>77bfd5a60e0691b0cebd180a0fd85eb65fa7f362</Sha>
99
</Dependency>
1010
</ToolsetDependencies>
1111
</Dependencies>

eng/common/darc-init.ps1

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
param (
22
$darcVersion = $null,
3-
$versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16",
4-
$verbosity = "m"
3+
$versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16',
4+
$verbosity = 'minimal',
5+
$toolpath = $null
56
)
67

78
. $PSScriptRoot\tools.ps1
89

9-
function InstallDarcCli ($darcVersion) {
10-
$darcCliPackageName = "microsoft.dotnet.darc"
10+
function InstallDarcCli ($darcVersion, $toolpath) {
11+
$darcCliPackageName = 'microsoft.dotnet.darc'
1112

1213
$dotnetRoot = InitializeDotNetCli -install:$true
1314
$dotnet = "$dotnetRoot\dotnet.exe"
@@ -23,11 +24,24 @@ function InstallDarcCli ($darcVersion) {
2324
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
2425
}
2526

26-
$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json'
27+
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
2728

2829
Write-Host "Installing Darc CLI version $darcVersion..."
29-
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
30-
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g --framework netcoreapp2.1
30+
Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.'
31+
if (-not $toolpath) {
32+
Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
33+
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g
34+
}else {
35+
Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity --tool-path '$toolpath'"
36+
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath"
37+
}
3138
}
3239

33-
InstallDarcCli $darcVersion
40+
try {
41+
InstallDarcCli $darcVersion $toolpath
42+
}
43+
catch {
44+
Write-Host $_.ScriptStackTrace
45+
Write-PipelineTelemetryError -Category 'Darc' -Message $_
46+
ExitWithExitCode 1
47+
}

eng/common/dotnet-install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
1414
version='Latest'
1515
architecture=''
1616
runtime='dotnet'
17+
runtimeSourceFeed=''
18+
runtimeSourceFeedKey=''
1719
while [[ $# > 0 ]]; do
1820
opt="$(echo "$1" | awk '{print tolower($0)}')"
1921
case "$opt" in
@@ -29,6 +31,14 @@ while [[ $# > 0 ]]; do
2931
shift
3032
runtime="$1"
3133
;;
34+
-runtimesourcefeed)
35+
shift
36+
runtimeSourceFeed="$1"
37+
;;
38+
-runtimesourcefeedkey)
39+
shift
40+
runtimeSourceFeedKey="$1"
41+
;;
3242
*)
3343
echo "Invalid argument: $1"
3444
exit 1

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
},
1212
"msbuild-sdks": {
13-
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.20269.3",
13+
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.20278.5",
1414
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2"
1515
}
1616
}

src/absil/illib.fs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,6 @@ module List =
264264
let rec loop i xs = match xs with [] -> false | h :: t -> f i h || loop (i+1) t
265265
loop 0 xs
266266

267-
let existsTrue (xs: bool list) =
268-
let rec loop i xs = match xs with [] -> false | h :: t -> h || loop (i+1) t
269-
loop 0 xs
270-
271267
let lengthsEqAndForall2 p l1 l2 =
272268
List.length l1 = List.length l2 &&
273269
List.forall2 p l1 l2
@@ -334,13 +330,6 @@ module List =
334330
| [] -> None
335331
| h :: t -> if f h then Some (h, List.rev acc @ t) else loop (h :: acc) t
336332
loop [] inp
337-
338-
let headAndTail l =
339-
match l with
340-
| [] ->
341-
Debug.Assert(false, "empty list")
342-
failwith "List.headAndTail"
343-
| h :: t -> h, t
344333

345334
let zip4 l1 l2 l3 l4 =
346335
List.zip l1 (List.zip3 l2 l3 l4) |> List.map (fun (x1, (x2, x3, x4)) -> (x1, x2, x3, x4))

src/fsharp/IlxGen.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7914,7 +7914,7 @@ let CodegenAssembly cenv eenv mgbuf fileImpls =
79147914
// top-level initialization code.
79157915
let extraBindings = mgbuf.GrabExtraBindingsToGenerate()
79167916
//printfn "#extraBindings = %d" extraBindings.Length
7917-
if extraBindings.Length > 0 then
7917+
if not (isNil extraBindings) then
79187918
let mexpr = TMDefs [ for b in extraBindings -> TMDefLet(b, range0) ]
79197919
let _emptyTopInstrs, _emptyTopCode =
79207920
CodeGenMethod cenv mgbuf ([], "unused", eenv, 0, (fun cgbuf eenv ->

src/fsharp/MethodCalls.fs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,12 +1868,15 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs =
18681868

18691869
// Fix bug 1281: If we resolve to an instance method on a struct and we haven't yet taken
18701870
// the address of the object then go do that
1871-
if minfo.IsStruct && minfo.IsInstance && (match argExprs with [] -> false | h :: _ -> not (isByrefTy g (tyOfExpr g h))) then
1872-
let h, t = List.headAndTail argExprs
1873-
let wrap, h', _readonly, _writeonly = mkExprAddrOfExpr g true false PossiblyMutates h None m
1874-
Some (wrap (Expr.Op (TOp.TraitCall traitInfo, [], (h' :: t), m)))
1871+
if minfo.IsStruct && minfo.IsInstance then
1872+
match argExprs with
1873+
| h :: t when not (isByrefTy g (tyOfExpr g h)) ->
1874+
let wrap, h', _readonly, _writeonly = mkExprAddrOfExpr g true false PossiblyMutates h None m
1875+
Some (wrap (Expr.Op (TOp.TraitCall traitInfo, [], (h' :: t), m)))
1876+
| _ ->
1877+
Some (MakeMethInfoCall amap m minfo methArgTys argExprs)
18751878
else
1876-
Some (MakeMethInfoCall amap m minfo methArgTys argExprs )
1879+
Some (MakeMethInfoCall amap m minfo methArgTys argExprs)
18771880

18781881
| Choice2Of5 (tinst, rfref, isSet) ->
18791882
match isSet, rfref.RecdField.IsStatic, argExprs.Length with

src/fsharp/NicePrint.fs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,12 +1473,14 @@ module InfoMemberPrinting =
14731473
let prettifyILMethInfo (amap: Import.ImportMap) m (minfo: MethInfo) typarInst ilMethInfo =
14741474
let (ILMethInfo(_, apparentTy, dty, mdef, _)) = ilMethInfo
14751475
let (prettyTyparInst, prettyTys), _ = PrettyTypes.PrettifyInstAndTypes amap.g (typarInst, (apparentTy :: minfo.FormalMethodInst))
1476-
let prettyApparentTy, prettyFormalMethInst = List.headAndTail prettyTys
1477-
let prettyMethInfo =
1478-
match dty with
1479-
| None -> MethInfo.CreateILMeth (amap, m, prettyApparentTy, mdef)
1480-
| Some declaringTyconRef -> MethInfo.CreateILExtensionMeth(amap, m, prettyApparentTy, declaringTyconRef, minfo.ExtensionMemberPriorityOption, mdef)
1481-
prettyTyparInst, prettyMethInfo, prettyFormalMethInst
1476+
match prettyTys with
1477+
| prettyApparentTy :: prettyFormalMethInst ->
1478+
let prettyMethInfo =
1479+
match dty with
1480+
| None -> MethInfo.CreateILMeth (amap, m, prettyApparentTy, mdef)
1481+
| Some declaringTyconRef -> MethInfo.CreateILExtensionMeth(amap, m, prettyApparentTy, declaringTyconRef, minfo.ExtensionMemberPriorityOption, mdef)
1482+
prettyTyparInst, prettyMethInfo, prettyFormalMethInst
1483+
| _ -> failwith "prettifyILMethInfo - prettyTys empty"
14821484

14831485
/// Format a method to a buffer using "standalone" display style.
14841486
/// For example, these are the formats used when printing signatures of methods that have not been overridden,

src/fsharp/TypeChecker.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9266,9 +9266,8 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) =
92669266
let m = cleanSynArg.Range
92679267
let rec check overallTyOpt expr (delayed: DelayedItem list) =
92689268
match expr with
9269-
| LongOrSingleIdent (false, (LongIdentWithDots(longId, _) as lidd), _, _) when longId.Length > 0 ->
9269+
| LongOrSingleIdent (false, (LongIdentWithDots((id::rest) as longId, _) as lidd), _, _) ->
92709270
let ad = env.eAccessRights
9271-
let id, rest = List.headAndTail longId
92729271
match ResolveLongIndentAsModuleOrNamespaceOrStaticClass cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m false true OpenQualified env.eNameResEnv ad id rest true with
92739272
| Result modref when delayed.IsEmpty && modref |> List.exists (p23 >> IsEntityAccessible cenv.amap m ad) ->
92749273
() // resolved to a module or namespace, done with checks

0 commit comments

Comments
 (0)