Skip to content

Commit

Permalink
Address remaining PROTOTYPE comments (#67109)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyTs authored Mar 1, 2023
1 parent cd79be3 commit e9ceebd
Show file tree
Hide file tree
Showing 14 changed files with 241 additions and 242 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static IReadOnlyDictionary<ParameterSymbol, FieldSymbol> GetCapturedParam

foreach (var parameter in captured)
{
// PROTOTYPE(PrimaryConstructors): Figure out naming strategy
// https://github.com/dotnet/roslyn/issues/67103: Figure out naming strategy
// Some thoughts/recommendations from Tomas:
// We should define GeneratedNameKind entry (e..g P looks free to use) and add a helper to GeneratedNames that produces the name.
// I'd also just keep the name as short as possible to avoid unnecessary metadata bloat. Could be just <name>P.
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ private void CompileSynthesizedSealedAccessors(SourcePropertySymbolBase sourcePr
}
}

// PROTOTYPE(PrimaryConstructors): Unify with GenerateMethodBody/SynthesizesLoweredBoundBody
// https://github.com/dotnet/roslyn/issues/67104: Unify with GenerateMethodBody/SynthesizesLoweredBoundBody
private void CompileFieldLikeEventAccessor(SourceEventSymbol eventSymbol, bool isAddMethod)
{
Debug.Assert(_moduleBeingBuiltOpt != null);
Expand Down Expand Up @@ -1929,7 +1929,7 @@ syntaxNode is ConstructorDeclarationSyntax constructorSyntax &&
var property = sourceMethod.AssociatedSymbol as SourcePropertySymbolBase;
if (property is not null && property.IsAutoPropertyWithGetAccessor)
{
// PROTOTYPE(PrimaryConstructors): Unify with GenerateMethodBody/SynthesizesLoweredBoundBody
// https://github.com/dotnet/roslyn/issues/67104: Unify with GenerateMethodBody/SynthesizesLoweredBoundBody
return MethodBodySynthesizer.ConstructAutoPropertyAccessorBody(sourceMethod);
}

Expand Down
36 changes: 18 additions & 18 deletions src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2163,24 +2163,24 @@ internal enum ErrorCode
ERR_UnrecognizedRefSafetyRulesAttributeVersion = 9103,
ERR_BadSpecialByRefUsing = 9104,

ERR_InvalidPrimaryConstructorParameterReference = 9500, // PROTOTYPE(PrimaryConstructors): pack numbers
ERR_AmbiguousPrimaryConstructorParameterAsColorColorReceiver = 9501,
WRN_CapturedPrimaryConstructorParameterPassedToBase = 9502,
ERR_AnonDelegateCantUseRefLike = 9503,
ERR_UnsupportedPrimaryConstructorParameterCapturingRef = 9504,
ERR_UnsupportedPrimaryConstructorParameterCapturingRefLike = 9505,
ERR_AnonDelegateCantUseStructPrimaryConstructorParameterInMember = 9506,
ERR_AnonDelegateCantUseStructPrimaryConstructorParameterCaptured = 9507,
WRN_UnreadPrimaryConstructorParameter = 9508,
ERR_AssgReadonlyPrimaryConstructorParameter = 9509,
ERR_RefReturnReadonlyPrimaryConstructorParameter = 9510,
ERR_RefReadonlyPrimaryConstructorParameter = 9511,
ERR_AssgReadonlyPrimaryConstructorParameter2 = 9512,
ERR_RefReturnReadonlyPrimaryConstructorParameter2 = 9513,
ERR_RefReadonlyPrimaryConstructorParameter2 = 9514,
ERR_RefReturnPrimaryConstructorParameter = 9515,
ERR_StructLayoutCyclePrimaryConstructorParameter = 9516,
ERR_UnexpectedParameterList = 9517,
ERR_InvalidPrimaryConstructorParameterReference = 9105,
ERR_AmbiguousPrimaryConstructorParameterAsColorColorReceiver = 9106,
WRN_CapturedPrimaryConstructorParameterPassedToBase = 9107,
ERR_AnonDelegateCantUseRefLike = 9108,
ERR_UnsupportedPrimaryConstructorParameterCapturingRef = 9109,
ERR_UnsupportedPrimaryConstructorParameterCapturingRefLike = 9110,
ERR_AnonDelegateCantUseStructPrimaryConstructorParameterInMember = 9111,
ERR_AnonDelegateCantUseStructPrimaryConstructorParameterCaptured = 9112,
WRN_UnreadPrimaryConstructorParameter = 9113,
ERR_AssgReadonlyPrimaryConstructorParameter = 9114,
ERR_RefReturnReadonlyPrimaryConstructorParameter = 9115,
ERR_RefReadonlyPrimaryConstructorParameter = 9116,
ERR_AssgReadonlyPrimaryConstructorParameter2 = 9117,
ERR_RefReturnReadonlyPrimaryConstructorParameter2 = 9118,
ERR_RefReadonlyPrimaryConstructorParameter2 = 9119,
ERR_RefReturnPrimaryConstructorParameter = 9120,
ERR_StructLayoutCyclePrimaryConstructorParameter = 9121,
ERR_UnexpectedParameterList = 9122,

#endregion

Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/Errors/MessageID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ internal enum MessageID
IDS_FeatureLambdaOptionalParameters = MessageBase + 12831,
IDS_FeatureLambdaParamsArray = MessageBase + 12832,

IDS_FeaturePrimaryConstructors = MessageBase + 12900, // PROTOTYPE(PrimaryConstructors): Pack numbers
IDS_FeaturePrimaryConstructors = MessageBase + 12833,
}

// Message IDs may refer to strings that need to be localized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ internal sealed class SynthesizedPrimaryConstructor : SourceConstructorSymbolBas
{
private IReadOnlyDictionary<ParameterSymbol, FieldSymbol>? _capturedParameters = null;

// PROTOTYPE(PrimaryConstructors): rename file
public SynthesizedPrimaryConstructor(
SourceMemberContainerTypeSymbol containingType,
TypeDeclarationSyntax syntax) :
Expand Down
Loading

0 comments on commit e9ceebd

Please sign in to comment.