Skip to content

Commit 00d315f

Browse files
committed
Generic fixes
1 parent 2bea31a commit 00d315f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

csharp-api/AssemblyGenerator/ClassGenerator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ private void GenerateProperties() {
345345
bodyStatements.Add(SyntaxFactory.ParseStatement(internalFieldName + ".Invoke(null, new object[] {value});"));
346346

347347
setter = setter.AddBodyStatements(bodyStatements.ToArray());
348-
} else if (t.IsGenericType()) {
348+
} else if (generic) {
349349
var index = t.Methods.IndexOf(property.Value.setter);
350350
setter = setter
351351
.AddBodyStatements(GenericStub(null, [], index))
@@ -477,7 +477,7 @@ private void GenerateFields() {
477477

478478
getter = getter.AddBodyStatements(bodyStatementsGetter.ToArray());
479479
setter = setter.AddBodyStatements(bodyStatementsSetter.ToArray());
480-
} else if (t.IsGenericType()) {
480+
} else if (generic) {
481481
getter = getter
482482
.AddBodyStatements(ParseStatement("throw new System.NotImplementedException();"))
483483
.WithAttributeLists([]);
@@ -747,7 +747,7 @@ private void GenerateMethods() {
747747
methodDeclaration = methodDeclaration.AddBodyStatements(
748748
[.. bodyStatements]
749749
);
750-
} else if (t.IsGenericType()) {
750+
} else if (generic) {
751751
var index = t.Methods.IndexOf(method);
752752
methodDeclaration = methodDeclaration
753753
.AddBodyStatements(GenericStub(returnType, [.. paramNames], index))
@@ -783,7 +783,7 @@ [.. bodyStatements]
783783
var array_generic = TDB.Get().GetType("!0[]");
784784
if (array_generic is null) return null;
785785

786-
var decl = new ClassGenerator(array_generic).typeDeclaration;
786+
var decl = new ClassGenerator(array_generic, true).typeDeclaration;
787787
return decl
788788
.WithIdentifier(Identifier("Impl"))
789789
.WithTypeParameterList(TypeParameterList(SingletonSeparatedList(TypeParameter("T"))));

0 commit comments

Comments
 (0)