diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generators/CLI/CLIMarshal.cs index ae211ec5..75672601 100644 --- a/src/Generator/Generators/CLI/CLIMarshal.cs +++ b/src/Generator/Generators/CLI/CLIMarshal.cs @@ -501,7 +501,7 @@ namespace CppSharp.Generators.CLI } PrimitiveType primitive; - if (decl.Type.Desugar().IsPrimitiveType(out primitive)) + if (decl.Type.IsPrimitiveType(out primitive)) { Context.Return.Write("(::{0})", typedef.Declaration.QualifiedOriginalName); } diff --git a/src/Generator/Generators/CLI/CLISourcesTemplate.cs b/src/Generator/Generators/CLI/CLISourcesTemplate.cs index a6281968..6182d191 100644 --- a/src/Generator/Generators/CLI/CLISourcesTemplate.cs +++ b/src/Generator/Generators/CLI/CLISourcesTemplate.cs @@ -970,7 +970,7 @@ namespace CppSharp.Generators.CLI if (Driver.Options.MarshalCharAsManagedChar) { foreach (var param in method.Parameters.Where( - p => p.Type.Desugar().IsPrimitiveType(PrimitiveType.Int8))) + p => p.Type.IsPrimitiveType(PrimitiveType.Int8))) { WriteLine("if ({0} < System::Char::MinValue || {0} > System::SByte::MaxValue)", param.Name); WriteLineIndent( diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index c5aaebc4..52e2fe6c 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -2105,7 +2105,7 @@ namespace CppSharp.Generators.CSharp if (Driver.Options.MarshalCharAsManagedChar) { foreach (var param in method.Parameters.Where( - p => p.Type.Desugar().IsPrimitiveType(PrimitiveType.Int8))) + p => p.Type.IsPrimitiveType(PrimitiveType.Int8))) { WriteLine("if ({0} < char.MinValue || {0} > sbyte.MaxValue)", param.Name); WriteLineIndent( @@ -2690,7 +2690,7 @@ namespace CppSharp.Generators.CSharp WriteLineIndent("EntryPoint=\"{0}\")]", function.Mangled); - if (function.ReturnType.Type.Desugar().IsPrimitiveType(PrimitiveType.Bool)) + if (function.ReturnType.Type.IsPrimitiveType(PrimitiveType.Bool)) WriteLine("[return: MarshalAsAttribute(UnmanagedType.I1)]"); var @params = new List(); diff --git a/src/Generator/Passes/CheckIgnoredDecls.cs b/src/Generator/Passes/CheckIgnoredDecls.cs index fc90c237..1d200420 100644 --- a/src/Generator/Passes/CheckIgnoredDecls.cs +++ b/src/Generator/Passes/CheckIgnoredDecls.cs @@ -342,7 +342,7 @@ namespace CppSharp.Passes var arrayType = type as ArrayType; PrimitiveType primitive; if (arrayType != null && arrayType.SizeType == ArrayType.ArraySize.Constant && - !arrayType.Type.Desugar().IsPrimitiveType(out primitive) && + !arrayType.Type.IsPrimitiveType(out primitive) && !arrayType.Type.Desugar().IsPointerToPrimitiveType()) { msg = "unsupported";