I'm trying to have a property with a union type of a lambda function or a string.
class TestClass {
name: string | () => string;
}
Non-working TS playground sample can be accessed here.
But the TS compiler gives an error: "[ts] Member 'string' implicitly has an 'any' type."
Is the type declared incorrectly? Or is there a workaround for this?