Hi there, thank you for your great library, with it I can finally get my DI framework up and running.
While playing with SuperNode, I found a bug in it, with the following code:
public class MyDisposable : IDisposable {
public void Dispose() { }
}
[SuperNode(typeof(GenericWithWhereClause<MyDisposable>))]
public partial class TestNode : Node {
public override partial void _Notification(int what);
}
[PowerUp]
public class GenericWithWhereClause<T> where T : IDisposable {
public void OnMyPowerUp(int what) { }
}
The generated code will become:
#pragma warning disable
#nullable enable
using System;
using Godot;
using SuperNodes.Types;
partial class TestNode where global::MyDisposable : IDisposable
{
public void OnMyPowerUp(int what)
{
}
}
#nullable disable
#pragma warning restore
Which is definitely not legal C# code.
This PR fix this bug by strip the where clauses from the PowerUp code.
Removing the where clauses in the PowerUp code should not be a problem as the generic parameters of PowerUp are replaced with real type during code generation... am I right?
This is my first time playing with C#'s codegen technology, mistakes may be made, feel free to leave any comments, or you can reject this if you decide to fix this by yourself.
Hi there, thank you for your great library, with it I can finally get my DI framework up and running.
While playing with SuperNode, I found a bug in it, with the following code:
The generated code will become:
Which is definitely not legal C# code.
This PR fix this bug by strip the where clauses from the PowerUp code.
Removing the where clauses in the PowerUp code should not be a problem as the generic parameters of PowerUp are replaced with real type during code generation... am I right?
This is my first time playing with C#'s codegen technology, mistakes may be made, feel free to leave any comments, or you can reject this if you decide to fix this by yourself.