-
Any @typescript experts know why it's allowed to cast between different string literal types? Why does
'foo' as const as 'bar'
type check successfully? Feels like it should be disallowed? This is disallowed in function returns, but not casts? Details: typescriptlang.org/play?#code/PTAEHUFMEsCcBMA0oBGBXALqA9gawHSgDkAZttkaADbQaSwCGVoAFgwM6gOgAG7GsaADsA5j1AYAngAdIyIdizcepckXFTZ+AFAhQAZWygAkqBGQsAdxaSJLaJwC2DXJE7tIQj6EgA3T6DQJIEYRJzcZIoAtCJoQjoAxtheWLBuaFQYAIwAXMQoDLCUALzEkZQc+YVEANzaumD6LNgZ8EJEWDyVSSkaMpAhEkYq5TwA-BA2gZy01JAiTEOgCRxYJLDYjg28qhQaw0QFRTzIlRgskLbsza2oA8JJjtIMGNAoVAOabmPaPfygaXYGQwACZQKVdhVOH8lJxDtU6tsADIWTgCWyWWg3TrdZL8Hj4QnaEhxBKvZKgSIACmE0kweUhAEoGUdKABvbSgLmgPQAUVgG1goCiZTU01AClh7GgIiEDHenyM8KKhAAsi43KAPF5IISdNyeWA0hg0LAhIEhHSMIiDXpwNhYLhOCKmi0qG0OiYJZBIPAlit-hhhnFcApLEJxCQ4PwfgbjabzbTMFw4ay6gBfIA