From 80c987a1e64c25ba177ba5083f36d44c8d1567d8 Mon Sep 17 00:00:00 2001 From: triton Date: Thu, 25 Jul 2013 01:04:18 +0100 Subject: [PATCH] Use an explicit cast instead of "as" since there should always be a namespace. --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 88eac888..f7338f0e 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1277,15 +1277,13 @@ namespace CppSharp.Generators.CSharp var method = function as Method; - bool isValueType = false; - bool needsInstance = false; + var isValueType = false; + var needsInstance = false; if (method != null) { - var @class = method.Namespace as Class; - - if (@class != null) - isValueType = @class.IsValueType; + var @class = (Class) method.Namespace; + isValueType = @class.IsValueType; needsInstance = !method.IsStatic;