Skip to content

Commit 8585ce4

Browse files
author
msftbot[bot]
authored
Merge pull request #45959 from dotnet/merges/master-to-features/target-typing
Merge master to features/target-typing
2 parents 6415297 + 7eb6986 commit 8585ce4

File tree

186 files changed

+3523
-1924
lines changed

Some content is hidden

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

186 files changed

+3523
-1924
lines changed

eng/config/PublishData.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@
185185
"vsBranch": "master",
186186
"vsMajorVersion": 16
187187
},
188-
"features/dotnetFormat": {
188+
"features/UsedAssemblyReferences": {
189189
"nugetKind": [ "Shipping", "NonShipping" ],
190-
"version": "3.3.*",
190+
"version": "3.8.*",
191191
"nuget": [ "https://dotnet.myget.org/F/roslyn/api/v2/package" ],
192192
"vsix": [ "https://dotnet.myget.org/F/roslyn/vsix/upload" ],
193-
"channels": [ "dotnetFormat" ],
193+
"channels": [ "UsedAssemblyReferences" ],
194194
"vsBranch": "master",
195195
"vsMajorVersion": 16
196196
},

src/Analyzers/Core/Analyzers/RemoveUnusedMembers/AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,8 @@ private bool IsCandidateSymbol(ISymbol memberSymbol)
696696
}
697697

698698
private bool IsEntryPoint(IMethodSymbol methodSymbol)
699-
=> (methodSymbol.Name == WellKnownMemberNames.EntryPointMethodName || methodSymbol.Name == "$Main") &&
699+
=> (methodSymbol.Name == WellKnownMemberNames.EntryPointMethodName || methodSymbol.Name == "<Main>$") && // https://github.com/dotnet/roslyn/issues/45110 Switch to using WellKnownMemberNames.TopLevelStatementsEntryPointMethodName
700+
// once src\CodeStyle\Core\Analyzers\Microsoft.CodeAnalysis.CodeStyle.csproj is able to use the latest version of the type.
700701
methodSymbol.IsStatic &&
701702
(methodSymbol.ReturnsVoid ||
702703
methodSymbol.ReturnType.SpecialType == SpecialType.System_Int32 ||

src/Compilers/CSharp/Portable/Binder/Binder_QueryErrors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ internal void ReportQueryLookupFailed(
4949
}
5050
else if (ImplementsStandardQueryInterface(instanceArgument.Type, name, ref useSiteDiagnostics))
5151
{
52-
// Could not find an implementation of the query pattern for source type '{0}'. '{1}' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?
52+
// Could not find an implementation of the query pattern for source type '{0}'. '{1}' not found. Are you missing required assembly references or a using directive for 'System.Linq'?
5353
diagnostics.Add(new DiagnosticInfoWithSymbols(
5454
ErrorCode.ERR_QueryNoProviderStandard,
5555
new object[] { instanceArgument.Type, name },

src/Compilers/CSharp/Portable/CSharpResources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3299,7 +3299,7 @@ A catch() block after a catch (System.Exception e) block can catch non-CLS excep
32993299
<value>Could not find an implementation of the query pattern for source type '{0}'. '{1}' not found. Consider explicitly specifying the type of the range variable '{2}'.</value>
33003300
</data>
33013301
<data name="ERR_QueryNoProviderStandard" xml:space="preserve">
3302-
<value>Could not find an implementation of the query pattern for source type '{0}'. '{1}' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?</value>
3302+
<value>Could not find an implementation of the query pattern for source type '{0}'. '{1}' not found. Are you missing required assembly references or a using directive for 'System.Linq'?</value>
33033303
</data>
33043304
<data name="ERR_QueryNoProvider" xml:space="preserve">
33053305
<value>Could not find an implementation of the query pattern for source type '{0}'. '{1}' not found.</value>

src/Compilers/CSharp/Portable/Declarations/DeclarationTreeBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private static SingleNamespaceOrTypeDeclaration CreateSimpleProgram(GlobalStatem
131131
{
132132
return new SingleTypeDeclaration(
133133
kind: DeclarationKind.SimpleProgram,
134-
name: SimpleProgramNamedTypeSymbol.UnspeakableName,
134+
name: WellKnownMemberNames.TopLevelStatementsEntryPointTypeName,
135135
arity: 0,
136136
modifiers: DeclarationModifiers.Internal | DeclarationModifiers.Partial | DeclarationModifiers.Static,
137137
declFlags: (hasAwaitExpressions ? SingleTypeDeclaration.TypeDeclarationFlags.HasAwaitExpressions : SingleTypeDeclaration.TypeDeclarationFlags.None) |

src/Compilers/CSharp/Portable/Parser/LanguageParser.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6867,13 +6867,9 @@ private TypeSyntax ParseUnderlyingType(ParseTypeMode mode, NameOptions options =
68676867
return ParseFunctionPointerTypeSyntax();
68686868
}
68696869

6870-
var name = this.CreateMissingIdentifierName();
6871-
if (mode != ParseTypeMode.NewExpression)
6872-
{
6873-
return this.AddError(name, ErrorCode.ERR_TypeExpected);
6874-
}
6875-
6876-
return name;
6870+
return this.AddError(
6871+
this.CreateMissingIdentifierName(),
6872+
mode == ParseTypeMode.NewExpression ? ErrorCode.ERR_BadNewExpr : ErrorCode.ERR_TypeExpected);
68776873
}
68786874

68796875
#nullable enable
@@ -11505,11 +11501,11 @@ private ExpressionSyntax ParseArrayOrObjectCreationExpression()
1150511501
initializer = this.ParseObjectOrCollectionInitializer();
1150611502
}
1150711503

11508-
// we need one or the other
11504+
// we need one or the other. also, don't bother reporting this if we already complained about the new type.
1150911505
if (argumentList == null && initializer == null)
1151011506
{
1151111507
argumentList = _syntaxFactory.ArgumentList(
11512-
this.EatToken(SyntaxKind.OpenParenToken, ErrorCode.ERR_BadNewExpr),
11508+
this.EatToken(SyntaxKind.OpenParenToken, ErrorCode.ERR_BadNewExpr, reportError: type?.ContainsDiagnostics == false),
1151311509
default(SeparatedSyntaxList<ArgumentSyntax>),
1151411510
SyntaxFactory.MissingToken(SyntaxKind.CloseParenToken));
1151511511
}

0 commit comments

Comments
 (0)