After reading through https://github.com/Microsoft/TypeScript/issues/7642 and https://github.com/Microsoft/TypeScript/pull/9407, it seems that enum literal types are supposed to work. However, I encountered a strange issue:
const enum STATUS {
CREATED = 201,
NOT_FOUND = 404,
}
const statusCode: STATUS.CREATED = 404; // no error is shown
Is it valid to assign values to enum members in this way?
TypeScript version being used: 2.3