deepkit-framework
                                
                                 deepkit-framework copied to clipboard
                                
                                    deepkit-framework copied to clipboard
                            
                            
                            
                        validation of literal types not working
I came across the following issue using deepkit/type 1.0.1-alpha.151:
type MyType = 'StringLiteral';
class MyClass {
    myProperty!: MyType
}
const myObject = {
    myProperty: 'NotMyType'
};
const value = cast<MyClass>(myObject);
I would expect cast to throw a ValidationError because 'NotMyType' is not compatible with the type MyType. Instead, no error is thrown and value.myProperty has the value StringLiteral. Using options of { loosely: false } does not change the behavior.