mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 16:15:38 +00:00
Generic type parameters cannot be primitive types in Java. Fixed!
This commit is contained in:
parent
e643d97317
commit
9848b51089
|
@ -162,7 +162,7 @@ namespace Bind
|
|||
static void WriteWrapper(Function f, BindStreamWriter sw)
|
||||
{
|
||||
var valid = true;
|
||||
var generic_parameters = GenerateGenericParameterString(f);
|
||||
var generic_parameters = GenerateGenericTypeString(f);
|
||||
var parameters = GenerateParameterString(f, out valid);
|
||||
if (!valid)
|
||||
return;
|
||||
|
@ -211,7 +211,10 @@ namespace Bind
|
|||
else
|
||||
sb.Append("Ref<");
|
||||
|
||||
sb.Append(p.CurrentType);
|
||||
// Hack: primitive types cannot be used as type parameters in Java.
|
||||
// Ensure the first letter is upper-case in order to use the boxed versions
|
||||
// of primitive types (i.e. "Byte" rather than "byte" etc).
|
||||
sb.Append(Char.ToUpper(p.CurrentType[0]) + p.CurrentType.Substring(1));
|
||||
sb.Append(">");
|
||||
}
|
||||
else if (p.Pointer > 0 && p.Array > 0)
|
||||
|
@ -246,9 +249,9 @@ namespace Bind
|
|||
|
||||
#endregion
|
||||
|
||||
#region GenerateGenericParameterString
|
||||
#region GenerateGenericTypeString
|
||||
|
||||
static string GenerateGenericParameterString(Function f)
|
||||
static string GenerateGenericTypeString(Function f)
|
||||
{
|
||||
var parameters = f.Parameters.Where(p => p.Generic);
|
||||
if (parameters.Count() > 0)
|
||||
|
|
Loading…
Reference in a new issue