-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support C# 9 Source Generators #14
Comments
I have the same question. |
@mob-sakai any comments here? |
@shwuhk @shtse8 @hellozyemlya |
@shwuhk @shtse8 @hellozyemlya UnitGenerator example: #if CUSTOM_COMPILE // This directive is required for Unity 2021.1 or later.
using NUnit.Framework;
namespace SourceGenerator
{
public class Unit
{
[Test]
public void UnitToString()
{
var userId = new UserId(1234);
Assert.AreEqual("UserId(1234)", userId.ToString());
}
[Test]
public void AsPrimitive()
{
var userId = new UserId(1234);
Assert.AreEqual(1234, userId.AsPrimitive());
}
}
[UnitGenerator.UnitOf(typeof(int))]
public readonly partial struct UserId { }
}
#endif |
Feature looks great testing it now. Do I understand correctly that source genrator has to be in NuGet? Is it possible to add custom generators by adding dll to the project? |
Thanks for building this great project.
I tried this project and it works great with C# 9 syntax.
However, I cannot make it work with C# 9 Source Generators. May I know if this support?
I am using Unity 2020.3.
The text was updated successfully, but these errors were encountered: