Conversation
|
Thank you! Will look later. |
|
I am quite ashamed to say that I can't explain how these warnings show up in my project and not in yours. I do use Polysharp which comes with some polyfills and analyzers but even when removing u still see some. SDK is the same too. But when I find out I think I would try to add a change here to reveal them. I think it's important for the src packages because in the end of the target project can't build these it's useless. At the same time ignoring all these like I did in this PR is fine because this is the same code as the non-src ones so it's as good. Ideally the BuildInternal script would inject code to ignore all warnings, this way you do what you want and these why will work anywhere. |
|
I asked chatgpt and I think I found the solution. Update incoming. Much simpler, and hassle-free for you. |
345f73c to
93a0900
Compare
93a0900 to
eddbc4f
Compare
| { | ||
| $content = Get-Content -path $file | ||
| $content = $content -creplace "public(?=\s+(((abstract|sealed|static|record)\s+)?(partial\s+)?class|delegate|enum|interface|struct|record))", "internal" | ||
| $content = ,"#pragma warning disable" + $content # $content is a list of lines, insert at the top |
There was a problem hiding this comment.
This generates the #pragma warning disable for each internal files.
This way the warnings are not ignored in your standard code, in case you want to see and handle them individually
| protected internal virtual Expression VisitDebugInfo(DebugInfoExpression node) => node; | ||
| } | ||
|
|
||
| #nullable restore No newline at end of file |
There was a problem hiding this comment.
This is not necessary at the end of files, these directives are per-file.
| @@ -1,4 +1,6 @@ | |||
| using System; | |||
| #nullable disable | |||
There was a problem hiding this comment.
Added #nullable disable for every file, since this will be necessary for internal files, and you really don't use nullable types.
|
|
||
| [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] | ||
| class CallerArgumentExpression : Attribute | ||
| class CallerArgumentExpressionAttribute : Attribute |
There was a problem hiding this comment.
There would be a conflict otherwise in internal files in some fwks, it would be conflicted between this and the real ones when it's used later in the code.
| public static StringBuilder Argument(StringBuilder sb, int ordinal) => sb.AppendFormat(CultureInfo.InvariantCulture, "V_{0}", ordinal); | ||
| public static StringBuilder Label(StringBuilder sb, int offset) => sb.AppendFormat(CultureInfo.InvariantCulture, "IL_{0:D4}", offset); | ||
|
|
||
| public static StringBuilder MultipleLabels(StringBuilder sb, int[] offsets) |
There was a problem hiding this comment.
Warnings could be ignored, but I think it's good to set the culture in case there is a side effect when rendered "technical" values like these.
| public static bool AllowPrintCS = false; | ||
| public static bool AllowPrintExpression = false; | ||
| public static bool DisableAssertOpCodes = false; | ||
| public static bool AllowPrintIL; |
There was a problem hiding this comment.
These were valid warnings appearing in my build. Though doesn't matter much in this case.
|
I am happy with these changes now. The main idea is to inject |
|
@sebastienros Thank you very much. Merging now. |
No description provided.