Beef
Beef copied to clipboard
Allow code emitted for extension to call methods from the project extending it
I want to be able to do
// namespace MyProject
[GenerateAMethod]
extension SomeClass
{
// Doesn't work because MyProject isn't available from the project that contains SomeClass
// Since extensions can use code from MyProject so should the generated code, right?
// I want to generate something like this
public MyProject.Data GetData() { ... }
}
struct GenerateAMethodAttribute : Attribute, IComptimeTypeApply
{
// Will generate a method as shown above
}
I found out it only emits code if the type being extended has the [Reflect]
attribute.