rbxts-flamework / core

Flamework is an extensible game framework. It requires typescript and offers many useful features.
MIT License
101 stars 8 forks source link

Macro nesting doesn't work if done between class methods #102

Closed rimuy closed 7 months ago

rimuy commented 7 months ago

When using macro nesting between methods, flamework throws an error and says the generic type from Modding.Many hasn't been encountered.

image

Minimal repro:

import { Modding } from "@flamework/core";

class Foo {
    /** @metadata macro */
    say<T extends string>(message: string, _text: Modding.Many<T>) {
        print(message, _text);
    }

    /** @metadata macro */
    sayHello<T extends string>(_text: Modding.Many<T>) {
        assert(_text);

        this.say<T>("Hello ", _text);
    }
}

Also I'm pretty sure in this case it would be unnecessary for this.say to need being called with a generic type? since the base macro is already receiving its modded parameter.