summaryrefslogtreecommitdiff
path: root/ICSharpCode.Decompiler
diff options
context:
space:
mode:
authorPaul DiPietro <paul.dipietro@me.com>2016-04-11 09:50:28 -0700
committerJason Smith <jason.smith@xamarin.com>2016-04-11 09:50:28 -0700
commitb2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c (patch)
tree227d1614c84e3d2dbe7f6231276955a6a174ff6d /ICSharpCode.Decompiler
parentc0468f1cc33fc4dc415c3a3ca4dc71986b04fc9c (diff)
downloadxamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.gz
xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.bz2
xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.zip
Enable CS0618 warnings as errors (#72)
CS0618 occurs when using an obsolete property or method. https://msdn.microsoft.com/en-us/library/x5ye6x1e.aspx
Diffstat (limited to 'ICSharpCode.Decompiler')
-rw-r--r--ICSharpCode.Decompiler/Ast/AstBuilder.cs2
-rw-r--r--ICSharpCode.Decompiler/Ast/TypesHierarchyHelpers.cs8
-rw-r--r--ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj4
3 files changed, 12 insertions, 2 deletions
diff --git a/ICSharpCode.Decompiler/Ast/AstBuilder.cs b/ICSharpCode.Decompiler/Ast/AstBuilder.cs
index faab2725..9826388f 100644
--- a/ICSharpCode.Decompiler/Ast/AstBuilder.cs
+++ b/ICSharpCode.Decompiler/Ast/AstBuilder.cs
@@ -1661,7 +1661,9 @@ namespace ICSharpCode.Decompiler.Ast
if (member.DeclaringType.BaseType != null) {
var baseTypeRef = member.DeclaringType.BaseType;
while (baseTypeRef != null) {
+#pragma warning disable 618
var baseType = baseTypeRef.ResolveOrThrow();
+#pragma warning restore 618
if (baseType.HasProperties && AnyIsHiddenBy(baseType.Properties, member, m => !m.IsIndexer()))
return true;
if (baseType.HasEvents && AnyIsHiddenBy(baseType.Events, member))
diff --git a/ICSharpCode.Decompiler/Ast/TypesHierarchyHelpers.cs b/ICSharpCode.Decompiler/Ast/TypesHierarchyHelpers.cs
index e4131904..19e7ff24 100644
--- a/ICSharpCode.Decompiler/Ast/TypesHierarchyHelpers.cs
+++ b/ICSharpCode.Decompiler/Ast/TypesHierarchyHelpers.cs
@@ -370,10 +370,14 @@ namespace ICSharpCode.Decompiler.Ast
var baseType = type.Item.BaseType;
var genericBaseType = baseType as GenericInstanceType;
if (genericBaseType != null) {
+#pragma warning disable 618
type = new GenericContext<TypeDefinition>(genericBaseType.ResolveOrThrow(),
+#pragma warning restore 618
genericBaseType.GenericArguments.Select(t => type.ResolveWithContext(t)));
} else
+#pragma warning disable 618
type = new GenericContext<TypeDefinition>(baseType.ResolveOrThrow());
+#pragma warning restore 618
yield return type;
}
}
@@ -441,7 +445,9 @@ namespace ICSharpCode.Decompiler.Ast
var resolvedElementType = ResolveWithContext(typeSpecification.ElementType);
return ReplaceElementType(typeSpecification, resolvedElementType);
}
+#pragma warning disable 618
return type.ResolveOrThrow();
+#pragma warning restore 618
}
TypeReference ReplaceElementType(TypeSpecification ts, TypeReference newElementType)
@@ -460,7 +466,9 @@ namespace ICSharpCode.Decompiler.Ast
return new ByReferenceType(newElementType);
}
// TODO: should we throw an exception instead calling Resolve method?
+#pragma warning disable 618
return ts.ResolveOrThrow();
+#pragma warning restore 618
}
public GenericContext<T2> ApplyTo<T2>(T2 item) where T2 : class
diff --git a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
index b00bed97..7bfc0abe 100644
--- a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
+++ b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
@@ -44,11 +44,11 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0219;0414</NoWarn>
+ <NoWarn>0219;0414</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0219;0414</NoWarn>
+ <NoWarn>0219;0414</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />