I added this question on SO:
is there a way to enforce static class properties? https://stackoverflow.com/questions/48813814/enforce-static-member-in-class-using-enum
It doesn't look like there is a way to do what I want to do, hence the feature request.
Code
declare enum Foods {
CHERRY = 'CHERRY',
LETTUCE = 'LETTUCE',
JERKY = 'JERKY'
}
declare abstract class ForceFoods {
static food : Foods
}
export class MyFoods implements ForceFoods {
static food = Foods.CHERRY; // if I omit this line, tsc will not complain
}
Expected behavior:
I was hoping tsc could enforce static properties to be defined
Actual behavior:
I don't currently believe tsc can enforce static properties
I added this question on SO:
is there a way to enforce static class properties? https://stackoverflow.com/questions/48813814/enforce-static-member-in-class-using-enum
It doesn't look like there is a way to do what I want to do, hence the feature request.
Code
Expected behavior:
I was hoping tsc could enforce static properties to be defined
Actual behavior:
I don't currently believe tsc can enforce static properties