Skip to content

Commit

Permalink
Merge pull request #58493 from dotnet/merges/main-to-features/require…
Browse files Browse the repository at this point in the history
…d-members

Merge main to features/required-members
  • Loading branch information
dotnet-bot authored Dec 26, 2021
2 parents ce663db + 05b2c02 commit e8598a4
Show file tree
Hide file tree
Showing 69 changed files with 1,227 additions and 528 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"files.associations": {
"**/eng/pipelines/*.yml": "azure-pipelines"
}
},
"omnisharp.defaultLaunchSolution": "Compilers.sln",
}
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.21615.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.21623.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>943d03f62955c771825dfa1f1bdeb8f853a2d7dd</Sha>
<Sha>4abaab2bf44d06638abeb23fc96c4f6eef58a2f0</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.1.0-2.21609.7">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>818313426323d979747781a17c78860c833776da</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.21615.1">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.21623.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>943d03f62955c771825dfa1f1bdeb8f853a2d7dd</Sha>
<Sha>4abaab2bf44d06638abeb23fc96c4f6eef58a2f0</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
3 changes: 3 additions & 0 deletions eng/common/dotnet-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ case $cpuname in
aarch64)
buildarch=arm64
;;
loongarch64)
buildarch=loongarch64
;;
amd64|x86_64)
buildarch=x64
;;
Expand Down
3 changes: 2 additions & 1 deletion eng/common/native/CommonLibrary.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ function Get-MachineArchitecture {
}
if (($ProcessorArchitecture -Eq "AMD64") -Or
($ProcessorArchitecture -Eq "IA64") -Or
($ProcessorArchitecture -Eq "ARM64")) {
($ProcessorArchitecture -Eq "ARM64") -Or
($ProcessorArchitecture -Eq "LOONGARCH64")) {
return "x64"
}
return "x86"
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"xcopy-msbuild": "16.10.0-preview2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21615.1",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21615.1"
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21623.1",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21623.1"
}
}
5 changes: 3 additions & 2 deletions src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
<Compile Include="$(MSBuildThisFileDirectory)AddAccessibilityModifiers\CSharpAddAccessibilityModifiersCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)AddAccessibilityModifiers\CSharpAddAccessibilityModifiersService.cs" />
<Compile Include="$(MSBuildThisFileDirectory)AddBraces\CSharpAddBracesCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertNamespace\ConvertNamespaceCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertNamespace\ConvertNamespaceTransform.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertTypeOfToNameOf\CSharpConvertTypeOfToNameOfCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs" />
Expand Down Expand Up @@ -78,4 +76,7 @@
<ItemGroup Condition="'$(DefaultLanguageSourceExtension)' != '' AND '$(BuildingInsideVisualStudio)' != 'true'">
<ExpectedCompile Include="$(MSBuildThisFileDirectory)**\*$(DefaultLanguageSourceExtension)" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)ConvertNamespace\" />
</ItemGroup>
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1717,13 +1717,13 @@ await TestInRegularAndScript1Async(
}

[WorkItem(46785, "https://github.com/dotnet/roslyn/issues/46785")]
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/46785"), Trait(Traits.Feature, Traits.Features.CodeActionsMakeFieldReadonly)]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsMakeFieldReadonly)]
public async Task UsedAsRef_NoDiagnostic()
{
await TestMissingInRegularAndScriptAsync(
@"public class C
{
private string [|_x|] = string.Empty;
private string [|x|] = string.Empty;
public bool M()
{
Expand All @@ -1733,6 +1733,26 @@ public bool M()
}");
}

[WorkItem(57983, "https://github.com/dotnet/roslyn/issues/57983")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsMakeFieldReadonly)]
public async Task UsedAsRef_NoDiagnostic_02()
{
await TestMissingInRegularAndScriptAsync(
@"using System.Runtime.CompilerServices;
public class Test
{
private ulong [|nextD3D12ComputeFenceValue|];
internal void Repro()
{
ref ulong d3D12FenceValue = ref Unsafe.NullRef<ulong>();
d3D12FenceValue = ref nextD3D12ComputeFenceValue;
d3D12FenceValue++;
}
}");
}

[WorkItem(42760, "https://github.com/dotnet/roslyn/issues/42760")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsMakeFieldReadonly)]
public async Task WithThreadStaticAttribute_NoDiagnostic()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2120,7 +2120,7 @@ void M()
{
void M()
{
#ifA || B
#if A || B
#endif
}
}",
Expand Down Expand Up @@ -2151,6 +2151,32 @@ void M()
offeredWhenRequireForClarityIsEnabled: true, index: 1);
}

[WorkItem(57768, "https://github.com/dotnet/roslyn/issues/57768")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryParentheses)]
public async Task TestParensAroundPPDirective3()
{
await TestAsync(
@"class C
{
void M()
{
#if C
#elif$$(A || B)
#endif
}
}",
@"class C
{
void M()
{
#if C
#elif A || B
#endif
}
}",
offeredWhenRequireForClarityIsEnabled: true);
}

[WorkItem(29454, "https://github.com/dotnet/roslyn/issues/29454")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryParentheses)]
public async Task TestMissingForPreIncrement()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,36 @@ public C(int [|i|])
}");
}

[WorkItem(56317, "https://github.com/dotnet/roslyn/issues/56317")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnusedParameters)]
public async Task NotImplementedException_NoDiagnostic4()
{
await TestDiagnosticMissingAsync(
@"using System;
class C
{
private int Goo(int [|i|])
=> throw new NotImplementedException();
}");
}

[WorkItem(56317, "https://github.com/dotnet/roslyn/issues/56317")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnusedParameters)]
public async Task NotImplementedException_NoDiagnostic5()
{
await TestDiagnosticMissingAsync(
@"using System;
class C
{
private int Goo(int [|i|])
{
throw new NotImplementedException();
}
}");
}

[WorkItem(41236, "https://github.com/dotnet/roslyn/issues/41236")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnusedParameters)]
public async Task NotImplementedException_MultipleStatements1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,18 @@ static bool IsSingleThrowNotImplementedOperation(IOperation firstBlock)
if (firstOp == null)
return false;

// unwrap: { throw new NYI(); }
if (firstOp is IExpressionStatementOperation expressionStatement)
{
// unwrap: { throw new NYI(); }
firstOp = expressionStatement.Operation;
}
else if (firstOp is IReturnOperation returnOperation)
{
// unwrap: 'int M(int p) => throw new NYI();'
// For this case, the throw operation is wrapped within a conversion operation to 'int',
// which in turn is wrapped within a return operation.
firstOp = returnOperation.ReturnedValue.WalkDownConversion();
}

// => throw new NotImplementedOperation(...)
return IsThrowNotImplementedOperation(notImplementedExceptionType, firstOp);
Expand All @@ -177,7 +186,7 @@ static bool IsSingleThrowNotImplementedOperation(IOperation firstBlock)
return firstOp;
}

static bool IsThrowNotImplementedOperation(INamedTypeSymbol notImplementedExceptionType, IOperation operation)
static bool IsThrowNotImplementedOperation(INamedTypeSymbol notImplementedExceptionType, IOperation? operation)
=> operation is IThrowOperation throwOperation &&
UnwrapImplicitConversion(throwOperation.Exception) is IObjectCreationOperation objectCreation &&
notImplementedExceptionType.Equals(objectCreation.Type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ internal static void ReportReservedTypeName(string? name, CSharpCompilation comp
{
if (compilation.LanguageVersion >= MessageID.IDS_FeatureRecords.RequiredVersion())
{
diagnostics.Add(ErrorCode.WRN_RecordNamedDisallowed, location, name);
diagnostics.Add(ErrorCode.WRN_RecordNamedDisallowed, location);
}
}
else if (IsReservedTypeName(name))
Expand Down
Loading

0 comments on commit e8598a4

Please sign in to comment.