From 99ca5a53fc9d3c2e111473fea81646116e85cdf8 Mon Sep 17 00:00:00 2001 From: Schabse Laks Date: Sun, 9 Nov 2014 09:25:12 -0500 Subject: [PATCH 1/4] git: Ignore Roslyn temp files --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e7c2de67d..5ab4836f1 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ obj/ _ReSharper*/ *.ReSharper *.patch -/packages \ No newline at end of file +/packages +*.ide/ From 5bd1892e9a98493f98b9fc082fb68712a75ece62 Mon Sep 17 00:00:00 2001 From: Schabse Laks Date: Sun, 9 Nov 2014 10:11:24 -0500 Subject: [PATCH 2/4] Temporary workaround for Roslyn compiler bug Roslyn doesn't look at inherited true/false operators. https://roslyn.codeplex.com/workitem/358 --- .../Tests/CustomShortCircuitOperators.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ICSharpCode.Decompiler/Tests/CustomShortCircuitOperators.cs b/ICSharpCode.Decompiler/Tests/CustomShortCircuitOperators.cs index f51908659..5bd0ec516 100644 --- a/ICSharpCode.Decompiler/Tests/CustomShortCircuitOperators.cs +++ b/ICSharpCode.Decompiler/Tests/CustomShortCircuitOperators.cs @@ -20,21 +20,19 @@ using System; public static class CustomShortCircuitOperators { - private class B + // TODO: Restore base class after https://roslyn.codeplex.com/workitem/358 is fixed. + private class C { - public static bool operator true(CustomShortCircuitOperators.B x) + public static bool operator true(CustomShortCircuitOperators.C x) { return true; } - public static bool operator false(CustomShortCircuitOperators.B x) + public static bool operator false(CustomShortCircuitOperators.C x) { return false; } - } - private class C : CustomShortCircuitOperators.B - { public static CustomShortCircuitOperators.C operator &(CustomShortCircuitOperators.C x, CustomShortCircuitOperators.C y) { return null; From be718680fe20f7351bf7748fbef1ad4876585d85 Mon Sep 17 00:00:00 2001 From: Schabse Laks Date: Sun, 9 Nov 2014 10:12:18 -0500 Subject: [PATCH 3/4] Add #pragma to suppress warning in test case --- ICSharpCode.Decompiler/Tests/CodeSampleFileParser.cs | 3 ++- ICSharpCode.Decompiler/Tests/Types/S_TypeMemberDeclarations.cs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/Tests/CodeSampleFileParser.cs b/ICSharpCode.Decompiler/Tests/CodeSampleFileParser.cs index 552d092ee..5cb49aad7 100644 --- a/ICSharpCode.Decompiler/Tests/CodeSampleFileParser.cs +++ b/ICSharpCode.Decompiler/Tests/CodeSampleFileParser.cs @@ -87,7 +87,8 @@ namespace ICSharpCode.Decompiler.Tests { if(String.IsNullOrWhiteSpace(s)) return true; - return s.Trim().StartsWith("//"); + s = s.Trim(); + return s.StartsWith("//") || s.StartsWith("#"); // Also ignore #pragmas for warning suppression } public static string ConcatLines(IEnumerable lines) diff --git a/ICSharpCode.Decompiler/Tests/Types/S_TypeMemberDeclarations.cs b/ICSharpCode.Decompiler/Tests/Types/S_TypeMemberDeclarations.cs index 22458bcfc..d8857c30a 100644 --- a/ICSharpCode.Decompiler/Tests/Types/S_TypeMemberDeclarations.cs +++ b/ICSharpCode.Decompiler/Tests/Types/S_TypeMemberDeclarations.cs @@ -664,7 +664,9 @@ namespace HideMembers3 } public class J2 : J { +#pragma warning disable 0108 // Deliberate bad code for test case public int get_P; +#pragma warning restore 0108 } } //$$ HideMembers4 From 09defcb4bd0a82205903f37898baba5983982911 Mon Sep 17 00:00:00 2001 From: Schabse Laks Date: Sun, 9 Nov 2014 10:18:02 -0500 Subject: [PATCH 4/4] Fix minor compiler warnings --- .../CodeIssues/OptionalParameterCouldBeSkippedIssue.cs | 2 -- .../Visitors/CSharpToVBConverterVisitor.cs | 2 +- NRefactory/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/OptionalParameterCouldBeSkippedIssue.cs b/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/OptionalParameterCouldBeSkippedIssue.cs index 6c7f378a4..6c681c8a1 100644 --- a/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/OptionalParameterCouldBeSkippedIssue.cs +++ b/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/OptionalParameterCouldBeSkippedIssue.cs @@ -84,7 +84,6 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring }); var issueMessage = ctx.TranslateString("Argument is identical to the default value"); var lastPositionalArgument = redundantArguments.FirstOrDefault(expression => !(expression is NamedArgumentExpression)); - bool hasNamedArguments = false; foreach (var argument in redundantArguments) { var localArgument = argument; @@ -100,7 +99,6 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring var newInvocation = generateReplacement(node, newArgumentList); script.Replace(node, newInvocation); })); - hasNamedArguments = true; } else { var title = ctx.TranslateString("Remove this and the following positional arguments"); actions.Add(new CodeAction(title, script => { diff --git a/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs b/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs index 9299eb99c..b2ff71cf5 100644 --- a/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs +++ b/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs @@ -800,7 +800,7 @@ namespace ICSharpCode.NRefactory.VB.Visitors throw new NotImplementedException(); - return EndNode(queryGroupClause, op); + //return EndNode(queryGroupClause, op); } public AstNode VisitAttribute(CSharp.Attribute attribute, object data) diff --git a/NRefactory/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs b/NRefactory/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs index 1e67de687..d18db55ed 100644 --- a/NRefactory/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs +++ b/NRefactory/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs @@ -87,6 +87,7 @@ namespace ICSharpCode.NRefactory.TypeSystem /// Warning: if delay-loading is used and the type system is accessed by multiple threads, /// the callback may be invoked concurrently on multiple threads. /// + [CLSCompliant(false)] public Action OnEntityLoaded { get; set; } ///