Skip to content

Commit

Permalink
Disambiguation crefs in generated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDunn committed Jun 21, 2024
1 parent 3bfd05c commit 3f38273
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Vogen.SharedTypes/ValueObjectAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public ValueObjectAttribute(
IsInitializedMethodGeneration isInitializedMethodGeneration = IsInitializedMethodGeneration.Unspecified,
PrimitiveEqualityGeneration primitiveEqualityGeneration = PrimitiveEqualityGeneration.Unspecified)
{
// DO NOT ADD PARAMETERS HERE, INSTEAD, CREATE OVERLOADS (at least until a new major version).
// This is because some users use reflection to find this attribute, and changing the amount
// of parameters is a binary-breaking change. See https://github.com/dotnet/runtime/issues/103722
// for more information.
}
}
}
4 changes: 2 additions & 2 deletions src/Vogen/GenerateCodeForParse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static string BuildParseWithFormatProviderMethodForAString(VoWorkItem it
/// <summary>
/// </summary>
/// <returns>
/// The value created via the <see cref=""From""/> method.
/// The value created via the <see cref=""From(global::System.String)""/> method.
/// </returns>
/// <exception cref=""ValueObjectValidationException"">Thrown when the value can be parsed, but is not valid.</exception>
{methodDecl}(global::System.String s, global::System.IFormatProvider provider) {{
Expand Down Expand Up @@ -132,7 +132,7 @@ private static void BuildParseMethod(IMethodSymbol methodSymbol, StringBuilder s
/// <summary>
/// </summary>
/// <returns>
/// The value created via the <see cref=""From""/> method.
/// The value created by calling the Parse method method on the primitive.
/// </returns>
/// <exception cref=""ValueObjectValidationException"">Thrown when the value can be parsed, but is not valid.</exception>
public {staticOrNot}{item.VoTypeName} Parse({parameters}) {{
Expand Down

0 comments on commit 3f38273

Please sign in to comment.