Skip to content

Regression: XML documentation respects accessibility now? #77

@MichaelKetting

Description

@MichaelKetting

Original reported on [CodePlex](unter https://roslyn.codeplex.com/workitem/69) by jonskeet

C# 5 compiler version: 12.0.30110.0
Roslyn version: 0.6.40331.3

Sometimes it's useful for doc comments to be able to refer to a member which that piece of code wouldn't actually be able to access. For example, a bunch of private constants in one method might have to be kept in sync with a bunch of private constants in another. It's ugly, but it can happen. Within the same assembly, it feels reasonable - outside the same assembly, less so.

The C# 5 compiler allows this when checking method references in cref attributes; Roslyn doesn't.

Test file attached - under the C# 5 compiler it compiles with no warnings; under Roslyn I get:

Test.cs(7,31): warning CS1574: XML comment has cref attribute 'Ford.Method' that could not be resolved
Test.cs(20,31): warning CS1574: XML comment has cref attribute 'Zaphod.Method' that could not be resolved

(As context, I discovered this when trying to build Noda Time with Roslyn - we have warnings as errors, so this broke our build.)

Repro Sample on CodePlex: Test.cs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions