Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Member still raises CS1591 in the main file even though the source generator has generated the doc comment #54166

Closed
KyouyamaKazusa0805 opened this issue Jun 17, 2021 · 2 comments
Labels
Area-Compilers Resolution-Duplicate The described behavior is tracked in another issue

Comments

@KyouyamaKazusa0805
Copy link

Version Used:
VS 16.11.0 Preview 2

Steps to Reproduce:

Write a source generator that not only generates the member, but also generates the doc comment, such as:

context.AddSource(
    $"{name}.g.cs",
    $@"#pragma warning disable 1591

using System.Runtime.CompilerServices;

#nullable enable

namespace {namespaceName}
{{
    partial {typeKind} {symbol.Name}{genericParametersList}
    {{
        /// <inheritdoc cref=""object.ToString""/>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public override {readonlyKeyword}partial string ToString() => ToString(null, null);

        /// <summary>
        /// Returns a string that represents the current object with the specified format string.
        /// </summary>
        /// <param name=""format"">
        /// The format. If available, the parameter can be <see langword=""null""/>.
        /// </param>
        /// <returns>The string result.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public {readonlyKeyword}partial string ToString(string? format) => ToString(format, null);
    }}
}}"
);

Expected Behavior:

In the main file, because of the success of the code generating, the main file doesn't raise CS1591.

Actual Behavior:

CS1591 still raised.

1

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 17, 2021
@Youssef1313
Copy link
Member

Youssef1313 commented Jun 17, 2021

Related to #54119 and #54103

@jaredpar
Copy link
Member

Agree this is a dupe of #54103

@jaredpar jaredpar added Resolution-Duplicate The described behavior is tracked in another issue and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

3 participants