-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Various loose ends in preparation for merging refout feature #19326
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
Changes from all commits
99f8b03
f73453b
ed29ec4
6c5b341
d881d9e
1993456
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2886,6 +2886,18 @@ public void ParseOut() | |
| // error CS8301: Do not use refout when using refonly. | ||
| Diagnostic(ErrorCode.ERR_NoRefOutWhenRefOnly).WithLocation(1, 1)); | ||
|
|
||
| parsedArgs = DefaultParse(new[] { @"/refout:ref.dll", "/link:b", "a.cs" }, baseDirectory); | ||
| parsedArgs.Errors.Verify( | ||
| // error CS8357: Cannot embed types when using /refout or /refonly. | ||
| Diagnostic(ErrorCode.ERR_NoEmbeddedTypeWhenRefOutOrRefOnly).WithLocation(1, 1) | ||
| ); | ||
|
|
||
| parsedArgs = DefaultParse(new[] { "/refonly", "/link:b", "a.cs" }, baseDirectory); | ||
| parsedArgs.Errors.Verify( | ||
| // error CS8357: Cannot embed types when using /refout or /refonly. | ||
| Diagnostic(ErrorCode.ERR_NoEmbeddedTypeWhenRefOutOrRefOnly).WithLocation(1, 1) | ||
| ); | ||
|
|
||
| parsedArgs = DefaultParse(new[] { "/refonly:incorrect", "a.cs" }, baseDirectory); | ||
| parsedArgs.Errors.Verify( | ||
| // error CS2007: Unrecognized option: '/refonly:incorrect' | ||
|
|
@@ -9067,6 +9079,11 @@ public static void Main() | |
| { | ||
| System.Console.Write(""Hello""); | ||
| } | ||
| /// <summary>Private method</summary> | ||
| private static void PrivateMethod() | ||
| { | ||
| System.Console.Write(""Private""); | ||
| } | ||
| }"); | ||
|
|
||
| var outWriter = new StringWriter(CultureInfo.InvariantCulture); | ||
|
|
@@ -9081,7 +9098,7 @@ public static void Main() | |
|
|
||
| MetadataReaderUtils.VerifyPEMetadata(exe, | ||
| new[] { "TypeDefinition:<Module>", "TypeDefinition:C" }, | ||
| new[] { "MethodDefinition:Void Main()", "MethodDefinition:Void .ctor()" }, | ||
| new[] { "MethodDefinition:Void Main()", "MethodDefinition:Void PrivateMethod()", "MethodDefinition:Void .ctor()" }, | ||
| new[] { "CompilationRelaxationsAttribute", "RuntimeCompatibilityAttribute", "DebuggableAttribute" } | ||
| ); | ||
|
|
||
|
|
@@ -9099,6 +9116,9 @@ public static void Main() | |
| <member name=""M:C.Main""> | ||
| <summary>Main method</summary> | ||
| </member> | ||
| <member name=""M:C.PrivateMethod""> | ||
| <summary>Private method</summary> | ||
| </member> | ||
| </members> | ||
| </doc>"; | ||
| Assert.Equal(expectedDoc, content.Trim()); | ||
|
|
@@ -9170,6 +9190,16 @@ private event Action E1 | |
| remove { } | ||
| } | ||
| private event Action E2; | ||
|
|
||
| /// <summary>Private Class Field</summary> | ||
| private int field; | ||
|
|
||
| /// <summary>Private Struct</summary> | ||
| private struct S | ||
| { | ||
| /// <summary>Private Struct Field</summary> | ||
| private int field; | ||
| } | ||
| }"); | ||
|
|
||
| var outWriter = new StringWriter(CultureInfo.InvariantCulture); | ||
|
|
@@ -9185,7 +9215,7 @@ private event Action E1 | |
| // The types and members that are included needs further refinement. | ||
| // See issue https://github.com/dotnet/roslyn/issues/17612 | ||
| MetadataReaderUtils.VerifyPEMetadata(refDll, | ||
| new[] { "TypeDefinition:<Module>", "TypeDefinition:C" }, | ||
| new[] { "TypeDefinition:<Module>", "TypeDefinition:C", "TypeDefinition:S" }, | ||
| new[] { "MethodDefinition:Void Main()", "MethodDefinition:Void .ctor()" }, | ||
| new[] { "CompilationRelaxationsAttribute", "RuntimeCompatibilityAttribute", "DebuggableAttribute", "ReferenceAssemblyAttribute" } | ||
| ); | ||
|
|
@@ -9207,10 +9237,20 @@ private event Action E1 | |
| <member name=""M:C.Main""> | ||
| <summary>Main method</summary> | ||
| </member> | ||
| <member name=""F:C.field""> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unexpected. We don't eliminate private fields of a class?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Such fields are stripped from the ref assembly, but not from the doc output. I'll take a stab tomorrow to strip it out. |
||
| <summary>Private Class Field</summary> | ||
| </member> | ||
| <member name=""T:C.S""> | ||
| <summary>Private Struct</summary> | ||
| </member> | ||
| <member name=""F:C.S.field""> | ||
| <summary>Private Struct Field</summary> | ||
| </member> | ||
| </members> | ||
| </doc>"; | ||
| Assert.Equal(expectedDoc, content.Trim()); | ||
|
|
||
|
|
||
| // Clean up temp files | ||
| CleanupAllGeneratedFiles(dir.Path); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Explicit interface implementations should be included. My understanding is that they are virtual, and we already concluded that all virtual methods should be included in ref assemblies. I'll add a test to lock that in.