Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kekyo committed Apr 30, 2024
1 parent 31169b1 commit 65d2d14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chibild/chibild.core/Generating/CodeGenerator_Consumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ private void ConsumeStructure(
this.OutputWarning(
structure.Scope.Token,
$"Ignored structure module scope, will place on internal scope.");
context.AddEnumeration(structureType, false);
context.AddStructure(structureType, false);
break;
default:
context.AddStructure(structureType, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,18 @@ private static bool TryCreateFixedLengthArrayType(
var vttr = requiredTypes["System.ValueType"];

var fullName = type.CilTypeName;
var ns = fullName.Substring(0, fullName.LastIndexOf('.'));
var name = fullName.Substring(ns.Length + 1);
string ns;
string name;
if (fullName.LastIndexOf('.') is { } ni && ni >= 0)
{
ns = fullName.Substring(0, ni);
name = fullName.Substring(ns.Length + 1);
}
else
{
ns = "";
name = fullName;
}

var valueArrayType = new TypeDefinition(
ns,
Expand Down

0 comments on commit 65d2d14

Please sign in to comment.